标签:ffffff mat bin roc har done can for one
proc String.fromCharCode {args} { set s [binary format s* $args] encoding convertfrom unicode $s } proc String.toCharCode {s} { set s [encoding convertto unicode $s] binary scan $s s* x;set x }
示例:
$ String.toCharCode hello > 104 101 108 108 111 $ String.toCharCode 你好 > 20320 22909 $ String.fromCharCode 104 101 108 108 111 > hello $ String.fromCharCode 20320 22909 > 你好
done.
tcl/string/20200225 fromCharCode, toCharCode
标签:ffffff mat bin roc har done can for one
原文地址:https://www.cnblogs.com/GCxokoA/p/12361420.html