Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: What's the best way to detect character encodings? (Redux)

by gnosti (Chaplain)
on Jun 10, 2013 at 05:02 UTC ( [id://1037986]=note: print w/replies, xml ) Need Help??


in reply to What's the best way to detect character encodings? (Redux)

I've heard that detecting encodings is a hard problem.
  • Comment on Re: What's the best way to detect character encodings? (Redux)

Replies are listed 'Best First'.
Re^2: What's the best way to detect character encodings? (Redux)
by Jim (Curate) on Jun 10, 2013 at 05:12 UTC

    It gets difficult when it's arbitrarily any "legacy" character encoding you're trying to detect. For that problem, fancy algorithms that use character frequencies, n-grams, dictionary look-ups, and other methods are required. But I'm able to factor out most of this complexity because I know that any text in a "legacy" single-byte encoding is ASCII/ISO-8859-1/Windows-1252. If it's not, then the damage I do converting it to UTF-8 will be what the provider of the text files deserves on-account-of-because she didn't provide me Unicode text as she was supposed to do in the first place.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (10)
As of 2024-04-16 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found