我有一個正在擴展到英國的應用程序,我需要添加對Latin-9 Unicode的支持。我做了一些谷歌搜索,但沒有發現什麼固定的過程中涉及什麼。有小費嗎?Perl latin-9? Unicode - 需要添加支持
下面是一些代碼(Unicode的東西只是位)
use Unicode::String qw(utf8 latin1 utf16);
# How to call
$encoded_txt = $self->unicode_encode($item->{value});
# Function part
sub unicode_encode {
shift() if ref($_[0]);
my $toencode = shift();
return undef unless defined($toencode);
Unicode::String->stringify_as("utf8");
my $unicode_str = Unicode::String->new();
# encode Perl UTF-8 string into latin1 Unicode::String
# - currently only Basic Latin and Latin 1 Supplement
# are supported here due to issues with Unicode::String .
$unicode_str->latin1($toencode);
...
任何幫助將是巨大的和感謝。
編輯: 我沒有找到這個帖子:http://czyborra.com/charsets/iso8859.html
爲什麼你需要支持Latin-9?對於您將要收到的數據,是否有特定的格式?如果您需要支持的某些字符而不是特定的字符集,我建議您使用Unicode和UTF-8。 – mpeters 2010-06-14 19:23:07
Latin-9就像帶有歐元符號的Latin-1,如果你不想或不能跳轉到Unicode,它是一種流行的選擇。 – leonbloy 2010-06-15 00:06:28
Latin-9是業務需求 – 2010-06-15 12:21:49