Kelly Jones wrote:

I "cpan Text::Unidecode" on 2 machines and then ran this code:

use utf8;
use Text::Unidecode;
print unidecode("\x{5317}\x{4EB0}")."\n";
print unidecode("\xd0\x90\xd0\xbb")."\n";
print unidecode("\xe3\x82\xa2")."\n";

On both machines, the first line correctly prints "Bei Jing", the
author's test case.

Second line: "Al" on one machine (correct), "DD>>" on the other.

Third line: "a" on one machine (correct), "aC/" on the other.

Thoughts?

$ perl -Mstrict -MEncode -MText::Unidecode -wle '
    my $s = "\xe3\x82\xa2";
    print Text::Unidecode::unidecode($s);
    Encode::_utf8_on($s);
    print Text::Unidecode::unidecode($s);
'
aC/
a


That is the output you should expect.


Text::Unidecode should not secretly "fix" the utf8-flag, for the same reason that "_utf_on" starts with an underscore.

$ perl -MText::Unidecode -wle'print $Text::Unidecode::VERSION'
0.04

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to