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 Stu
1 mins ago
tcl by dandyn
1 days ago
tcl by Stu
4 days ago
tcl by philbr-t
9 days ago
tcl by arjen
11 days ago
tcl by brain
18 days ago
tcl by mjanssen
20 days ago
tcl by godotdot
20 days ago
tcl by Bradipo
20 days ago
tcl by Stu
23 days ago
Submit
New paste
Documentation
From Jabber