On 07/11/09 17:33, Tintin72 wrote:
>
> Hi,
>
> I'm using Vim under both Win XP and Ubuntu/Linux and a files encoding
> pb occurs at
> the file opening.
> If I open a latin1 encoded file with Vim under Ubuntu, the Vim's
> fileencoding
> is utf-8 (so the file will be saved in utf-8 and I don't want to).
> It seems like Vim doesn't recognize the file encoding.
> I'd like vim to open file in latin1 encoding if the file is in latin1
> or utf8 encoding if file is in utf8.
> Is there something to type in the vimrc ?
>
> Thanks

If a file contains only characters in the range [0x00-0x7F], its 
representation is identical in US-ASCII, Latin1 or UTF-8. Therefore it 
doesn't matter in which of them it is opened, because in fact it is all 
three. Where it _would_ matter is if you add to it one or more 
characters above 0x7F while editing. To avoid that this situation arises 
later, you can force Vim to see the file as Latin1 by making it 
incompatible with UTF-8, for instance by underlining your top title with 
"divided by" signs, รท (0xF7), and making sure to save it _that time_ 
under Latin1 encoding.


Best regards,
Tony.
-- 
Chemistry is applied theology.
                -- Augustus Stanley Owsley III

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to