Welcome to the Monastery | |
PerlMonks |
Re: utf8 characters in tr/// or s///by moritz (Cardinal) |
on Sep 30, 2008 at 21:00 UTC ( [id://714640]=note: print w/replies, xml ) | Need Help?? |
The only sane approach is to use utf8;, and to decode the strings that DBI returns with Encode::decode_utf8, unless your DBD::mysql does that for you already.
I have no experience with tr and Unicode, but s/// works fine. When you want to print out stuff, you also need binmode STDOUT, ':encoding(UTF-8)'; or similar stuff. See also encodings, Unicode and Perl, perluniintro and perlunifaq. Update: And take a look at Text::Unidecode, it might safe you quite some work.
In Section
Seekers of Perl Wisdom
|
|