Using gVim, if I load your file normally, I do get ASCII instead of Unicode.
But if I then type:

:e ++enc=ucs-2

it appears to work. I don't have a Chinese font, so I get a box, but it is a
single character and it is double-width, so it appears to be interpreted
correctly by Vim. The same thing happens automatically if I insert the UCS-2
byte order mark "fe ff" at the start of the file.

The console version is a bit more tricky, and correct behavior from Vim
might depend on various system settings. In my case, the console version
reports a conversion error.

-----Original Message-----
From: Mike Li [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 06, 2007 1:53 AM
To: Doug Cook
Cc: vim-dev@vim.org
Subject: Re: bug: gvim 7.0.205 on xp can not display ucs-2

for big-endian, the following is displayed:

[EMAIL PROTECTED]@

for little-endian, the following is displayed:

8l^M^@
^@

"^@" and "^M" are control characters.

this definitely happens on gvim as well as console vim under windows
xp. i'm not sure if it happens with other programs in the console
window, as the platform is windows. i have the appropriate fonts, and
notepad displays the little-endian version correctly.

-x

On 3/6/07, Doug Cook <[EMAIL PROTECTED]> wrote:
> What gets displayed?
>
> Does this happen on gVim as well?
>
> Do Chinese characters appear correctly in the console window when using
> other programs?
>
> -----Original Message-----
> From: Mike Li [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 05, 2007 10:04 PM
> To: vim-dev@vim.org
> Subject: Re: bug: gvim 7.0.205 on xp can not display ucs-2
>
> console vim 7.0 (patches 1-205), built with the mingw compiler under
> cygwin (gcc -mno-cygwin), as well as the console vim 7.0.122 binary
> distributed with cygwin have the same problem as the gvim binaries
> under windows xp.
>
> -x
>
> On 3/5/07, Mike Li <[EMAIL PROTECTED]> wrote:
> > gvim 7.0 (patches 1-205) under windows xp, built with the mingw
> > compiler under cygwin (gcc -mno-cygwin), can not display ucs-2 text
> > files. see below for the xxd-dump of an ucs-2 text file containing a
> > single chinese character (U+6c38):
> >
> > 0000000: 6c 38 00 0d 00 0a                                l8....
> >
> > the same problem is seen with the little-endian (ucs-2le) version of
> > the same file:
> >
> > 0000000: 38 6c 0d 00 0a 00                                8l....
> >
> > the presence or absence of a BOM (byte order marker) at the beginning
> > of the file does not make a difference. the issue is also seen with
> > gvim from the original windows binary distribution.
> >
> > console vim 7.0 (patches 1-205) under fedora core 6, built with gcc
> > 4.0, works fine with '++enc=ucs-2'. the original binary from the yum
> > package vim-enhanced-7.0.201-1.fc6 also works fine.
> >
> > -x
> >
>
>

Reply via email to