Adrien Pied PiƩrard wrote:
Dear everyone,

As a polyglot vim user, I happen to write and read files written in
several languages, including multibyte ones.

It works very well, as long as the files I read are mine. When I
happen to read someone else's file, I often have problems, for the
text (say, Japanese) would not display correctly.
I often try various combinations I can think of, with enc, fenc and
fencs, but usually, to no good at all. And any try to understand the
help pages of those three variables has been mostly useless.

I share some of that same confusion with you. What I usually do when I find mojibake* in Vim is to view the file in a web browser like Firefox. These have pretty reliable automatic detection of character encodings (I believe Firefox includes a library just for this) and you can see/change which character encoding was chosen for the current page in the "View" menu. I make a note of the chosen encoding, switch back to Vim and execute:

        :edit ++enc=example

Where 'example' is the character encoding chosen by Firefox. Most of the time this enables me to view files in their intended encoding but I realize its an ugly workaround :-)

 - Peter Odding

* http://en.wikipedia.org/wiki/Mojibake

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to