Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hello Monks,
I'm having a utf8 string in Perl's internal form, obtained from Encode::decode() and would like to use tr/// to translate a list of Latin1 characters (65 characters in total). Obviously, tr/// does not convert the Latin1 characters to utf8, because in the test case below the Euro sign is not translated.
How can I accomplish this? I can lookup the codepoints for all characters in a foreach and replace the using a hash, but that's what we have tr/// for right? Thanks in advance! Update: I cannot do the translation before converting to utf8 because the string can be in different character sets. In reply to tr/// latin1 on utf8 string by Marcello
|
|