char -> unicode .. is there a prettier way?
Posted to
tcl
by aspect at Sat Apr 26 09:12:37 GMT 2014
view raw
proc
unicode {s} {
join
[lmap c [
split
$s
""] {
scan
$c
%c x
if
{
$x
< 1<<16} {
format
\\u%04x
$x
}
else
{
format
\\U%08x
$x
}
}] ""
}
Recent Posts
tcl by oldlaptop
1 days ago
tcl by apn
3 days ago
tcl by rmax
6 days ago
tcl by kevin_walzer
10 days ago
tcl by Bradipo
25 days ago
tcl by Stu
47 days ago
tcl by rhobart
60 days ago
tcl by stevel
64 days ago
tcl by dandyn
72 days ago
tcl by dandyn
72 days ago
Submit
New paste
Documentation
From Jabber