Glenn Fowler schrieb:
On Mon, 29 Oct 2007 00:05:40 +0100 Bernd Eggink wrote:
As to the original problem: I tried some other sequences, such as
$ a=(name='1รค') # 1 a-umlaut
--------------^
this example shows up as <SPACE> in email
OK. Let's write a single a-umlaut into file 'inp', either
saying "print <a-umlaut> >inp" or using the UTF-8 sequence:
$ print $'\xa4\xc3' > inp
$ cat inp # renders a-umlaut here
$ od -tx1 inp
0000000 c3 a4 0a
This is correct. Now the assignment:
$ a=(name=$(<inp))
$ print $a
The output contains a correctly UTF-8 encoded a-umlaut, as can be seen here:
$ print $a | od -tx1
0000000 28 20 6e 61 6d 65 3d c3 a4 20 29 0a
-----------------------------^^^^^
Now the quoted version:
$ print "$a"
This renders, in parenthesis, 'name==' and a capital A with tilde. Looking
at the bytes shows why:
$ print "$a" | od -ctx1
0000000 ( \n \t n a m e = = 303 \n ) \n
28 0a 09 6e 61 6d 65 3d 3d c3 0a 29 0a
You can see that after the equal sign (3d) the sequence 3d c3
has been generated, instead of c3 a4. C3 is the unicode value for capital A
with tilde.
Hope this helps,
Bernd
--
Bernd Eggink
[EMAIL PROTECTED]
http://sudrala.de
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers