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.