Version 11 of Things Chinese

Updated 2007-08-31 08:03:59 by arjen

* Chinlish

A Chinese website dedicated to Tcl/Tk:

RS 2006-05-30 adds


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.

Category Human Language | i18n - Tcl for the world | Natural Languages