OlegG has asked for the wisdom of the Perl Monks concerning the following question:
This file contains one letter. In the hex editor it looks like:open FH, '<:utf8', 'input.txt' or die $! my $str = <FH>; close FH;
And in the text editor it is "à". I think it is italian.C3 A0
I expected "Wide character in print" and this letter after, but all that I get is question mark inside black box "�".print $str;
output of the first example is as described above, but second works as expected (with "Wide character in print" and expected letter - "м" - from the cyrillic alphabet)echo -e "\xC3\xA0" | perl -pne 'BEGIN{binmode STDIN, ":utf8"}' echo -e "\xD0\xBC" | perl -pne 'BEGIN{binmode STDIN, ":utf8"}'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unicode problem with some letters
by moritz (Cardinal) on Aug 21, 2011 at 18:13 UTC | |
by OlegG (Monk) on Aug 21, 2011 at 18:25 UTC | |
by moritz (Cardinal) on Aug 21, 2011 at 19:54 UTC | |
by OlegG (Monk) on Aug 22, 2011 at 15:03 UTC | |
|
Re: Unicode problem with some letters
by Khen1950fx (Canon) on Aug 22, 2011 at 09:22 UTC | |
by OlegG (Monk) on Aug 22, 2011 at 15:06 UTC | |
|
Re: Unicode problem with some letters
by zentara (Cardinal) on Aug 22, 2011 at 16:22 UTC |