* Chinlish
A Chinese website dedicated to Tcl/Tk: http://tcltk.91com.net/
RS 2006-05-30 adds http://www.tclchina.com/
中文成?
RS 2007-08-29: Here's a converter from Chinese characters in Unicode to decimal GB2312 numbers:
proc c2gb str { set res "" foreach c [split $str ""] { binary scan [encoding convertto gb2312 $c] cc a b set a [expr {($a+0x100) % 0x100 - 160}] set b [expr {($b+0x100) % 0x100 - 160}] lappend res [format %02d%02d $a $b] } set res } % c2gb 上海 4147 2603
ZU 2007-08-09: Could you please tell me how can I use that, wenn I use TclKit zu show some character with chinise charaters? And I have tried
puts "\u2603" ;# the second nummber above
And I get ☃. May I ask why?
AM (31 august 2007) That is interesting in itself too :) but the problem is really that Unicode expects hexadecimal numbers, whereas the above are decimal. - RS: Yes. The Unicodes of these example characters can be scanned out:
% u2x 上海 \u4E0A\u6D77
Category Human Language | i18n - Tcl for the world | Natural Languages