Re: Workaround to a unicode bug needed

[email protected] (Pierre Nugues) Tue, 7 Sep 2010 11:48:22 +0200
Newsgroups perl.unicode
Message-ID <[email protected]>
Dear Karl,

It finally worked and I would like to thank you for your patience and your help. I could apply it to any text read from the standard input and avoid the CO options with these three lines in the beginning of the program.

use utf8;
binmode(STDOUT, ":encoding(UTF-8)");
binmode(STDIN, ":encoding(UTF-8)");

The program must read the standard input explicitly, which means that 

perl token_perl.pl text.txt

will not work. It has to be 

perl token_perl.pl < text.txt

instead.

Also, it is also pretty curious that the program worked fine in its original form, for all the characters with the exception of the quote » and that the problem disappeared when I removed the û character from the tr// list. Now everything works fine without this hack.

Thank you!!!!

Pierre