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 iobates
11 days ago
tcl by iobates
11 days ago
tcl by iobates
11 days ago
tcl by FLORENTIS
15 days ago
tcl by Florentis
15 days ago
tcl by schelte
20 days ago
tcl by iobates
20 days ago
tcl by cgm
21 days ago
tcl by iobates
26 days ago
tcl by FM
30 days ago
Submit
New paste
Documentation
From Jabber