[Comm] Re: Perl unicode
Stanislav Yadykin
tosick ÎÁ altlinux.ru
ðÔ ïËÔ 22 18:50:56 MSD 2004
В �ообщении от П�тница, 22-Окт-2004 17:25 Alexey Tourbin напи�ал(a):
> Лучше не и�пользовать Text::Iconv вме�те � нативным utf8.
> По крайней мере ниже�ледующее у мен� не работает:
>
> $ perl -MText::Iconv -le 'my $text="тек�т"; utf8::encode $text; print Text::Iconv->new("utf8", "windows-1251")->convert($text)'
ÐÑ�Ñ�Ñ�... вообще-то
utf8::encode($string)
Converts in-place the octets of the $string to the octet sequence in Perl's
UTF-X encoding. Returns nothing. Note that this does not change the "type" of
$string to UTF-8, and that this handles only ISO 8859-1 (or EBCDIC) as the source
character set. Therefore this should not be used to convert a legacy 8-bit encoding
to Unicode: use Encode::decode() for that.
� вот е�ли
-(~:$)-> perl "-MEncode('from_to')" -MText::Iconv -le 'my $text="тек�т"; from_to($text, "windows-1251", "utf8"); print Text::Iconv->new("utf8", "windows-1251")->convert($text)'
тек�т
> Может быть дело в том, что XML::Stream и�пользует
> use open ':utf8'
Смотрел, но подобного ничего нет.
--
Stanislav Yadykin
ALT Linux Team
----------- ÓÌÅÄÕÝÁÑ ÞÁÓÔØ -----------
Было удалено вложение не в тек�товом формате...
Им� : от�ут�твует
Тип : application/pgp-signature
Размер : 190 байтов
Опи�ание: от�ут�твует
Url : http://lists.altlinux.ru/pipermail/community/attachments/20041022/9af0b8df/attachment.bin
ðÏÄÒÏÂÎÁÑ ÉÎÆÏÒÍÁÃÉÑ Ï ÓÐÉÓËÅ ÒÁÓÓÙÌËÉ Community