I am finishing off some work getting Vim to work with Outlook.

Things were looking good until I tried to edit a message from a
Japanese co-worker.

The basic flow is this:
1.  Open the message in Outlook.
2.  Hit a toolbar icon which fires some VB code.
3.  The VB code opens which takes the body of the message and writes
it out to a file.
4.  Then uses Vim OLE object to edit it by sending the actual command
you would type:
         :e ++enc=utf-16 myfile.txt

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).

         :e ++enc=japan myfile.txt
This was closer, but still gibberish.

notepad can open the file and display it just fine (boo hiss).

Does the fileencodings option have to be setup in advance for certain pages?
For example, on my Windows machine, fileencodings is usual blank since
I have never needed unicode before.
So if I want to open this Japanese file, does the fileencodings option
need to be set, even if I specify ++enc when I edit the file?


Here is the InternetCodePage mappings:

Name Character Set                 Code Page
Arabic (Windows) windows-1256 1256
Baltic (ISO) iso-8859-4 28594
Central European (ISO) iso-8859-2 28592
Chinese Simplified (GB2312) gb2312 936
Chinese Traditional (Big5) big5 950
Cyrillic (KOI8-R) koi8-r 20866
Cyrillic (Windows) windows-1251 1251
Greek (ISO) iso-8859-7 28597
Hebrew (Windows) windows-1255 1255
Japanese (JIS) iso-2022-jp 50220
Korean ks_c_5601-1987 949
Thai (Windows) windows-874 874
Turkish (ISO) iso-8859-9 28599
Unicode (UTF-8) utf-8 65001
US-ASCII us-ascii 20127
Vietnamese (Windows) windows-1258 1258
Western European (ISO) iso-8859-1 28591


Do I have to come up with a ++enc for each of the encodings above, or
will a certain ++enc work for the more than 1 (or a vast majority of
them)?


Thanks for any help.

The whole unicode stuff makes my head hurt.

Dave

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

Reply via email to