Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to utf8 characters in tr/// or s///

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://714640]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-18 16:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found