latin9

Conversion from iso-8859-15 (Latin9) to UTF-8?

核能气质少年 提交于 2019-12-22 16:08:10
问题 I need to convert some strings formated with Latin9 charset to UTF-8. I cannot use iconv as it is not included in my embedded system. Do you know if there is some available code for it? 回答1: Code points 1 to 127 are the same in both Latin-9 (ISO-8859-15) and UTF-8. Code point 164 in Latin-9 is U+20AC, \xe2\x82\xac = 226 130 172 in UTF-8. Code point 166 in Latin-9 is U+0160, \xc5\xa0 = 197 160 in UTF-8. Code point 168 in Latin-9 is U+0161, \xc5\xa1 = 197 161 in UTF-8. Code point 180 in Latin-9

Perl Encode - UK characters

半腔热情 提交于 2019-12-11 12:30:29
问题 This is a part 2 question from This Question. So I'm trying out the :encode functionality but having no luck at all. use Encode; use utf8; # Should print: iso-8859-15 print "Latin-9 Encoding: ".find_encoding("latin9")->name."\n"; my $encUK = encode("iso-8859-15", "UK €"); print "Encoded UK: ".$encUK."\n"; Results: Encoded UK: UK € Shouldn't the results be encoded? what am I doing wrong here? EDIT: Added the suggested: use utf8; and now I get this: Encoded UK: UK � pulling hair out now :/ 回答1:

Conversion from iso-8859-15 (Latin9) to UTF-8?

半城伤御伤魂 提交于 2019-12-06 10:42:36
I need to convert some strings formated with Latin9 charset to UTF-8. I cannot use iconv as it is not included in my embedded system. Do you know if there is some available code for it? Code points 1 to 127 are the same in both Latin-9 (ISO-8859-15) and UTF-8. Code point 164 in Latin-9 is U+20AC, \xe2\x82\xac = 226 130 172 in UTF-8. Code point 166 in Latin-9 is U+0160, \xc5\xa0 = 197 160 in UTF-8. Code point 168 in Latin-9 is U+0161, \xc5\xa1 = 197 161 in UTF-8. Code point 180 in Latin-9 is U+017D, \xc5\xbd = 197 189 in UTF-8. Code point 184 in Latin-9 is U+017E, \xc5\xbe = 197 190 in UTF-8.

Perl latin-9? Unicode - need to add support

泄露秘密 提交于 2019-12-02 02:08:55
问题 I have an application that is being expanded to the UK and I will need to add support for Latin-9 Unicode. I have done some Googling but found nothing solid as to what is involved in the process. Any tips? Here is some code (Just the bits for Unicode stuff) 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);

Perl latin-9? Unicode - need to add support

半城伤御伤魂 提交于 2019-12-02 00:21:18
I have an application that is being expanded to the UK and I will need to add support for Latin-9 Unicode. I have done some Googling but found nothing solid as to what is involved in the process. Any tips? Here is some code (Just the bits for Unicode stuff) 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