Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: tr/// latin1 on utf8 string

by ikegami (Patriarch)
on Mar 13, 2008 at 15:54 UTC ( [id://673999]=note: print w/replies, xml ) Need Help??


in reply to tr/// latin1 on utf8 string

I cannot do the translation before converting to utf8 because the string can be in different character sets.

You can't work with strings if you don't know how they were encoded. Without that info, all you have is a bunch of meaningless bytes.

Once you get your encoding problem straightened out, you might be interested in Text::Unidecode. I'm not sure how it handles the euro symbol specifically, but it's great at ASCIIfying data.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found