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

Re: Encoding woes

Expand Messages
  • A. J. Mechelynck
    ... in your vimrc if &termencoding == let &termencoding = &encoding endif set encoding=utf-8 ... etc. ... in your vimrc if &termencoding == let
    Message 1 of 5 , May 26, 2005
    • 0 Attachment
      Alan Schmitt wrote:
      > Le 26 mai 05, à 08:58, Alan Schmitt a écrit :
      >
      >> Hello,
      >>
      >> I'm using Vim on a Mac, and everything was going well until I had to
      >> edit some files encoded in mac-roman. My default encoding is utf-8, so
      >> when I load such a file, I do not see the accents (I get some question
      >> marks instead, and the status line indicates [converted]). So to edit
      >> things correctly, I do a:
      >> set encoding=macroman
      >> but then I get something weird: every accent has a strange character
      >> right before it, as in:
      >> prs
      >>
      >> How can I use macroman without having these strange character appear?
      >
      >
      > Investigating a little more, it seems that if I do:
      > open the file
      > set enc=macroman
      > :e
      > then I get what I want.
      >
      > Is the required extra ":e" a bug?
      >
      > Thanks,
      >
      > Alan Schmitt

      Try the following:

      ----- for a single file:

      in your vimrc
      if &termencoding == ""
      let &termencoding = &encoding
      endif
      set encoding=utf-8

      then later:
      :e ++enc=macroman filename
      etc.

      ----- if most of your files are in macroman:

      in your vimrc
      if &termencoding == ""
      let &termencoding = &encoding
      endif
      set encoding=utf-8 fileencodings=ucs-bom,utf-8,macroman

      then later:
      :e filename
      etc.

      see (among others)
      :help ++opt
      :help 'fileencodings'

      HTH,
      Tony.
    Your message has been successfully submitted and would be delivered to recipients shortly.