Re: Decoding CJK characters to unicode in Tcl
- From: "suchenwi" <richard.suchenwirth-bauersachs@xxxxxxxxxxx>
- Date: 14 Mar 2007 10:55:46 -0700
Tcl natively uses Unicode for (almost) all strings.
Does this example from an interactive wish help?
proc u2x str {
set res {}
foreach c [split $str ""] {
scan $c %c i
append res [expr {$i>127? "\\u[format %04.4x $i]" : $c}]
}
set res
}
166 % u2x "太 酷 - very cool"
\u592a \u9177 - very cool
.
- Follow-Ups:
- Re: Decoding CJK characters to unicode in Tcl
- From: jhe618
- Re: Decoding CJK characters to unicode in Tcl
- References:
- Decoding CJK characters to unicode in Tcl
- From: jhe618
- Decoding CJK characters to unicode in Tcl
- Prev by Date: Hang on application close when using 'socket -server ...'
- Next by Date: Re: OSX like "dock" menu
- Previous by thread: Decoding CJK characters to unicode in Tcl
- Next by thread: Re: Decoding CJK characters to unicode in Tcl
- Index(es):
Relevant Pages
|