FordLawnmower commented on a Page, IRCStar.Org  -  Jun 19, 2010

Just curious why the giant string map. I see that you are not using the properly accented characters with your replacements.
This code will replace them correctly with all the right accents.

proc dehex {string} {
  set string [subst [regsub -nocase -all {\\u([a-f0-9]{4})} $string {[format %c [decimal \1]]}]]
  return $string
}
proc decimal {hex} { return [expr 0x$hex] }
proc hex {decimal} { return [format %x $decimal] }
_________________________________________________________________________________________________

To use this code , you would just put:
set news [dehex $news]
Instead of:
set news [string map ...................]

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.