Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Convert Windows-1252 Characters to Java Unicode Notationby Jim (Curate) |
on Nov 25, 2007 at 21:40 UTC ( [id://652865]=perlquestion: print w/replies, xml ) | Need Help?? |
Jim has asked for the wisdom of the Perl Monks concerning the following question:
Fellow Monks, I'm accessing text in a Microsoft Access database via DBI and DBD::ODBC that's stored in the Windows-1252 character encoding. I've proved to myself that it's coming out as Windows-1252 and not Latin 1 (ISO-88591-1) or UTF-8. I want to convert the characters to UTF-8 and then to Java Unicode Notation. For example, I want the Euro sign in Windows-1252 (\x80) to be printed to a text file as its equivalent Unicode character U+20AC transformed into the string '\u20ac'. Is there something ready-made for this purpose? I know about the Encode module, but I'm looking for the canonical solution to the last bit: converting the resultant UTF-8 into Java Unicode Notation. I've read too much documentation and now I'm confused. I want the simplest, most elegant solution. Thanks! Jim
Back to
Seekers of Perl Wisdom
|
|