Loading ...
Sorry, an error occurred while loading the content.

Re: encoding

Expand Messages
  • Henrik Öhman
    ... I m not sure in which encoding ö would be . In latin1 it seems to be . Do you know which encoding textshop uses? ... Those settings are a bit
    Message 1 of 5 , Oct 1, 2009
    • 0 Attachment
      On Sep 30, 5:07 pm, Doris Wagner <doris.wag...@...> wrote:
      > hi list,
      >
      > I am using vim from the terminal (mac os 10.5); I often use german  
      > umlauts;
      >
      > now, when I write the umlaut ö with another editor, in my case with  
      > texshop, and open the file with vim, there ist no ö displayed, but
      > <9a>;
      > apparently, something with the encoding is wrong;

      I'm not sure in which encoding ö would be <9a>. In latin1 it seems to
      be <f6>. Do you know which encoding textshop uses?

      > my .vimrc-settings are as in
      >
      > http://hoepfl.de/articles/2007/01/vimderbar.html
      >
      > recommended, that is:
      >
      > set encoding=utf-8
      > set fileencoding=
      > setglobal fileencoding=utf-8
      > set fileencodings=ucs-bom,utf-8,latin1 set termencoding=latin1

      Those settings are a bit misguided. First of all, 'termencoding'
      should be infered from your locale settings. Since you seem to want to
      work with utf-8, I suggest you change your terminal to use utf-8 too
      (if it doesn't already.) :h 'termencoding' has an example on how to
      use utf-8 even if system has no locale support for it.

      In .vimrc, :set fileencoding and :setglobal fileencoding basically do
      the same thing. Using both is not useful. Also, you only need to set
      'fileencoding' explicitly when it differs from 'encoding'.

      You shouldn't have to change 'fileencodings' at all.

      So, provided that your locale really is 'latin1', this should suffice:

      let &termencoding = &encoding
      set encoding=utf-8

      I would suggest, however, that you use an utf-8 locale, because then
      you don't have to change encoding settings at all (as long as you work
      with utf-8 files.)

      Henrik.
      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • björn
      ... Hi Doris, It seems that texshop is not using UTF-8 so either tell it to use UTF-8 or set the proper file encoding in Vim. I don t know which is the
      Message 2 of 5 , Oct 1, 2009
      • 0 Attachment
        2009/9/30 Doris Wagner:
        >
        > hi list,
        >
        > I am using vim from the terminal (mac os 10.5); I often use german
        > umlauts;
        >
        > now, when I write the umlaut ö with another editor, in my case with
        > texshop, and open the file with vim, there ist no ö displayed, but
        > <9a>;
        > apparently, something with the encoding is wrong;
        >
        > my .vimrc-settings are as in
        >
        > http://hoepfl.de/articles/2007/01/vimderbar.html
        >
        > recommended, that is:
        >
        > set encoding=utf-8
        > set fileencoding=
        > setglobal fileencoding=utf-8
        > set fileencodings=ucs-bom,utf-8,latin1 set termencoding=latin1
        >
        >
        > so can anyone help me?

        Hi Doris,

        It seems that texshop is not using UTF-8 so either tell it to use
        UTF-8 or set the proper file encoding in Vim. I don't know which is
        the correct one though...maybe somebody else on the list knows, or ask
        on vim_use.

        Björn

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Doris Wagner
        hi list, ... I changed this and now it seems to work; ... how can I find out what kind of encoding my terminal uses? many thanx doris
        Message 3 of 5 , Oct 1, 2009
        • 0 Attachment
          hi list,




          > let &termencoding = &encoding
          > set encoding=utf-8
          >

          I changed this and now it seems to work;

          > I would suggest, however, that you use an utf-8 locale, because then
          > you don't have to change encoding settings at all (as long as you work
          > with utf-8 files.)


          how can I find out what kind of encoding my terminal uses?

          many thanx
          doris





          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Tony Mechelynck
          ... Ox9A is not an o-umlaut in Latin1 or UTF-8: in Latin1 it is the control character SCI (Single Character Introducer), and in UTF-8, the _codepoint_ U+009A
          Message 4 of 5 , Oct 31, 2009
          • 0 Attachment
            On 30/09/09 17:07, Doris Wagner wrote:
            >
            > hi list,
            >
            > I am using vim from the terminal (mac os 10.5); I often use german
            > umlauts;
            >
            > now, when I write the umlaut ö with another editor, in my case with
            > texshop, and open the file with vim, there ist no ö displayed, but
            > <9a>;
            > apparently, something with the encoding is wrong;
            >
            > my .vimrc-settings are as in
            >
            > http://hoepfl.de/articles/2007/01/vimderbar.html
            >
            > recommended, that is:
            >
            > set encoding=utf-8
            > set fileencoding=
            > setglobal fileencoding=utf-8
            > set fileencodings=ucs-bom,utf-8,latin1 set termencoding=latin1
            >
            >
            > so can anyone help me?
            >
            > tia
            > doris

            Ox9A is not an o-umlaut in Latin1 or UTF-8: in Latin1 it is the control
            character SCI (Single Character Introducer), and in UTF-8, the
            _codepoint_ U+009A (encoded on disk as 0xC2 0x9A) is the same control
            character, while the _byte_ 0x9A can only be the second or further byte
            of a multibyte sequence.

            I suspect that Texshop is using macroman as its encoding, but only you
            can ascertain that, by trial and error, as follows (in Vim):

            (in the vimrc)
            ...
            if has('multi_byte')
            if &enc !~? '^u'
            if &tenc == ""
            let &tenc = &enc
            endif
            set enc=utf-8
            endif
            if 0
            " the following is optional
            " (check the help before uncommenting)
            set fencs=ucs-bom,utf-8,latin1
            setg bomb fenc=latin1
            endif
            endif
            ...

            (at the keyboard)
            :e ++enc=macroman filename.enc

            replacing "filename.enc" by the filename, of course. (You may want to
            have pre-recorded, using Texshop, a "test file" containing as many
            non-ASCII different characters as you can dream of.)

            If it still isn't that, you'll have to try other charsets (Windows-1252,
            maybe?) as the argument of the ++enc modifier.

            See ":help ++opt"


            Best regards,
            Tony.
            --
            Rule of the Great:
            When people you greatly admire appear to be thinking deep
            thoughts, they probably are thinking about lunch.

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          Your message has been successfully submitted and would be delivered to recipients shortly.