Oops, josephwu is my another account. Gmail just wrongly chose my out
mail addr. :(

Best,
Zhaojun

On 3/8/07, Joseph WU <[EMAIL PROTECTED]> wrote:
Hi, Cyril and Tony,

Thanks.

Tony's right. I just tested Cyril's solution. Unfortunately,  when
encoding=utf8 and fileencoding=cp936, line: "let char =
matchstr(getline("."), ".", col(".") - 1)" can only get the *FIRST*
8-bit out of a 2-byte cp936-encoded Chinese character. (To my
surprise, the hex value of the first 8-bit converted by iconv is
correct in cp936 encode standard. I just realized that iconv can just
convert a part of one Chinese Character.:)

I am trying to see if I can read the whole 2-byte Chinese char out or not.

Thanks,

Zhaojun

On 3/8/07, Cyril Slobin <[EMAIL PROTECTED]> wrote:
> On 3/7/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:
>
> > IIUC, the above is for 'encoding' and 'fileencoding' being both 8-bit
> > encodings. cp936 is the Microsoft encoding for mainland China: some 
characters
> > (such as ASCII) are 8 bits, others are 16 bits; and UTF-8 (the 'encoding'
> > Zhaojun uses) can use anywhere between 1 and 4 bytes to represent the
> > "assigned" codepoints. For instance, the highest Unicode codepoint currently
> > regarded as "valid" by the Unicode Consortium, U+10FFFD, is represented in
> > UTF-8 as F4 8F BF BD.
>
> No! The very goal of this code is that `encodig` is utf-8 while
> `fileencoding` is different. But you are right noting that I have not
> tested this `fileencoding` other than 8-bit one -- except the marginal
> case when it is utf-8 too. But again -- `encoding` *is* multibyte and
> it works. Why not just to test? I haven't Chinese fonts installed...
>
> --
> Cyril Slobin <[EMAIL PROTECTED]> `When I use a word,' Humpty Dumpty said,
> <http://45.free.net/~slobin> `it means just what I choose it to mean'
>


--
Best,
Zhaojun (Joseph)



--
Best,
Zhaojun (Joseph)

Reply via email to