Am 22.04.2009 15:49, David Fishburn schrieb: > On Tue, Apr 21, 2009 at 11:09 PM, Tony Mechelynck > <[email protected]> wrote: >> >> On 21/04/09 21:07, David Fishburn wrote: > ... >>> When we write out the file (from VB) we can tell it to create a unicode >>> file. >>> >>> In VB, I can look up the code page of the email. >>> It returns the last set of digits below, so for my Japanese email the >>> following is returned by VB: 50220 so using the chart below, I see >>> this line: >>> Japanese (JIS) iso-2022-jp 50220 >>> >>> So, now that I have written out a unicode file, I am trying to open it in >>> Vim. >>> I can't figure out what the actual :e line is to open this file. >>> >>> :e ++enc=utf-16 myfile.txt >>> :e ++enc=utf-8 myfile.txt >>> >>> Both leave the file unreadable in Vim (upside down question marks fill >>> the screen). >> >> Windows "Unicode" files are typically little-endian UTF-16, while in >> Vim, if you don't specify the endianness for 16- or 32-bit Unicode you >> get big-endian. So if I were you I'd try >> >> :e ++enc=utf-16le myfile.txt > ... > > Thanks Tony, that does open the file into a format that I can actually > read (good). > > Only one issue, when I open the file in Vim I get: > "rad13544.outlook" [converted][CONVERSION ERROR in line 377][unix] 424L, > 10698C > > Vim leaves the file in RO mode (which makes sense). > > Notepad and Microsoft Word open the file without any messages. > > Any ideas? > [...]
What does :set enc? return? If enc is not set to a Unicode encoding I think Vim won't be able to represent every Unicode character in memory. Therefore you'll get a conversion error when Vim tries to convert your file from UTF-16LE to its internal encoding. Or your file is not completely valid UTF-16LE. Can you post a complete example file? Or at least line 377 of this file? Perhaps Notepad and Word open the file without any messages because they are silently dropping any illegal bytes. You can instruct Vim to do the same by using the ++bad argument to the :e command. Read :help ++bad . HTH, Dennis Benzinger --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
