Re: Weird behavior of encoding & open pragmas
[email protected] (Jarkko Hietaniemi)
| Newsgroups | perl.unicode |
|---|---|
| Message-ID | <[email protected]> |
Marcin 'Qrczak' Kowalczyk wrote:
> $ perl -e 'use encoding "ISO-8859-2"; use open ":encoding(ISO-8859-2)"; print ord($ARGV[0]), chr(260), $ARGV[0], "\n"' Ä
> "\x{00a1}" does not map to iso-8859-2 at -e line 1.
> 260Ä\x{00a1}
>
> I don't understand it: ord($ARGV[0]) is 260, chr(260) can be printed,
> yet $ARGV[0] cannot be printed?
>
> Which part of Perl performs the recoding of @ARGV here?
It seems that my recent patch helps here, somehwta:
$ ./perl -Ilib -e 'use encoding "ISO-8859-2"; use open
":encoding(ISO-8859-2)"; print ord($ARGV[0]), chr(260), $ARGV[0], "\n"' Ä
Wide character in print at -e line 1.
260Ă
Ä
(Sorry about linewrap, my MUA insists...)
--
Jarkko Hietaniemi <[email protected]> http://www.iki.fi/jhi/ "There is this special
biologist word we use for 'stable'. It is 'dead'." -- Jack Cohen