Re: print hex value of cp936 Chinese char?

2007-03-07 Thread Cyril Slobin
On 3/7/07, Joseph WU <[EMAIL PROTECTED]> wrote: 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. (T

Re: print hex value of cp936 Chinese char?

2007-03-07 Thread Zhaojun WU
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 cha

Re: print hex value of cp936 Chinese char?

2007-03-07 Thread Joseph WU
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 h

Re: print hex value of cp936 Chinese char?

2007-03-07 Thread Cyril Slobin
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 us

Re: print hex value of cp936 Chinese char?

2007-03-07 Thread A.J.Mechelynck
Cyril Slobin wrote: On 3/7/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote: As long as 'encoding' is set to UTF-8, there is no easy way to get the cp936 value of a given character in the buffer. I don't know if there is something specific with cp936, but for encodings I use daily (cp866, cp1251

Re: print hex value of cp936 Chinese char?

2007-03-07 Thread Cyril Slobin
On 3/7/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote: As long as 'encoding' is set to UTF-8, there is no easy way to get the cp936 value of a given character in the buffer. I don't know if there is something specific with cp936, but for encodings I use daily (cp866, cp1251, koi8-r) the followin

Re: print hex value of cp936 Chinese char?

2007-03-07 Thread A.J.Mechelynck
Zhaojun WU wrote: Hi, Tony, Thanks for you reply. I've already tried the xxd solution, but it converts all of the characters into hex values, it is hard to locate a particular character's value. It might be possible to copy this character out to a new window and use ":%!xxd" to check its hex va

Re: print hex value of cp936 Chinese char?

2007-03-07 Thread Zhaojun WU
Hi, Tony, Thanks for you reply. I've already tried the xxd solution, but it converts all of the characters into hex values, it is hard to locate a particular character's value. It might be possible to copy this character out to a new window and use ":%!xxd" to check its hex value, but it takes t

Re: print hex value of cp936 Chinese char?

2007-03-07 Thread A.J.Mechelynck
Zhaojun WU wrote: Hi, all, Is it possible to print the hex value of the cp936-coded Chinese character under the current cursor, just like "ga" for the ASCII char. I found that "g8" can print the correct hex value of UTF8-encoded Chinese character in a openning UTF-8 encoded file. But, for a cp

print hex value of cp936 Chinese char?

2007-03-07 Thread Zhaojun WU
Hi, all, Is it possible to print the hex value of the cp936-coded Chinese character under the current cursor, just like "ga" for the ASCII char. I found that "g8" can print the correct hex value of UTF8-encoded Chinese character in a openning UTF-8 encoded file. But, for a cp936 (or GBK) encode