"string map" with binary data

From: Wolfram Roesler (wr_at_spam.la)
Date: 07/27/04


Date: 27 Jul 2004 09:06:06 GMT

Hello,

I tried the following to translate special characters in a
binary string:

  set Str2 [string map \
    {\x84 \{ \x94 | \x81 \} \x8E [ \x99 \\ \x9A ] \xE1 ~} \
    $Str1]

I was surprised to find that translation worked only for some
of the characters, namely \x81, \x8E, and \xE1. The others (\x84,
\x94 etc.) didn't get translated and ended up in Str2 unchanged.

I suppose that this is some kind of character set/encoding issue,
is it? If so, is there a way to make "string map" work with binary
data?

Thanks for your help
W. Rösler