А не лучше ли применить вот это? (из man perlunicode)
==={{{
"use encoding" needed to upgrade non-Latin-1 byte strings
By default, there is a fundamental asymmetry in Perl's unicode
model: implicit upgrading from byte strings to Unicode strings
assumes that they were encoded in ISO 8859-1 (Latin-1), but Unicode
strings are downgraded with UTF-8 encoding. This happens because
the first 256 codepoints in Unicode happens to agree with Latin-1.
If you wish to interpret byte strings as UTF-8 instead, use the
"encoding" pragma:
use encoding 'utf8';
See "Byte and Character Semantics" for more details.
===}}}
Конечно, лучше сделать чтобы вообще не было implicit upgrading, но это может оказаться проблемой сторонних модулей вроде DBI/DBD.
no subject
Date: 2005-02-19 07:41 am (UTC)==={{{
"use encoding" needed to upgrade non-Latin-1 byte strings By default, there is a fundamental asymmetry in Perl's unicode model: implicit upgrading from byte strings to Unicode strings assumes that they were encoded in ISO 8859-1 (Latin-1), but Unicode strings are downgraded with UTF-8 encoding. This happens because the first 256 codepoints in Unicode happens to agree with Latin-1. If you wish to interpret byte strings as UTF-8 instead, use the "encoding" pragma: use encoding 'utf8'; See "Byte and Character Semantics" for more details.===}}}
Конечно, лучше сделать чтобы вообще не было implicit upgrading, но это может оказаться проблемой сторонних модулей вроде DBI/DBD.