Decoding CJK characters to unicode in Tcl
- From: jhe618@xxxxxxxxx
- Date: 14 Mar 2007 10:25:45 -0700
I know how to display Chinese characters in Tk, such as wm title,
button names, etc. For example,
% wm title . "\u592a\u9177"
% button .f -text "\u592a\u9177" -font {-family MingLiU -size 16 -
weight bold}
I'll see "太 酷" (very cool).
My problem is how to decode a CJK character to its unicode in Tcl
given the CJK unicode table:
0 1 2 3 4 5 6 7 8 9 a b c d e f
4E00 一 丁 丂 七 丄 丅 丆 万 丈 三 上 下 丌 不 与 丏
4E10 丐 丑 丒 专 且 丕 世 丗 丘 丙 业 丛 东 丝 丞 丟
4E20 丠 両 丢 丣 两 严 並 丧 丨 丩 个 丫 丬 中 丮 丯
...
In tkcon, I can set a Chinese charter, i.e.
% set x 丏;
tkcon can display $x.
When I use "read" to load the table, tkcon cannot display it in
Chinese (I got ??? for Chinese characters).
If I combine $x with other string, i.e.
% set y "abc 丏".
% I'll get no match, 0 when I try:
% string math $x $y.
Any thought? Thanks in advance!
- Follow-Ups:
- Re: Decoding CJK characters to unicode in Tcl
- From: Arjen Markus
- Re: Decoding CJK characters to unicode in Tcl
- From: suchenwi
- Re: Decoding CJK characters to unicode in Tcl
- Prev by Date: Mixing Qt with Tcl (missing event processing ?)
- Next by Date: Interleaved lists and associative arrays
- Previous by thread: Mixing Qt with Tcl (missing event processing ?)
- Next by thread: Re: Decoding CJK characters to unicode in Tcl
- Index(es):