Autodetect encoding / mojibake correction?

C

Cameron Adamez

Hi,
Is there something to automatically detect what encoding a file is? That
way, I don't have to guess when using iconv.
Also, is there a script/gem/etc that can correct mojibake? If not, I want
to write it... though I'm not quite sure how...

Thanks,
Cameron
 
Z

Zev Blut

Hi,

Hi,
Is there something to automatically detect what encoding a file is? That
way, I don't have to guess when using iconv.
Also, is there a script/gem/etc that can correct mojibake? If not, I want
to write it... though I'm not quite sure how...

Check our NKF and Kconv in Ruby's standard lib.

NKF.guess can be used for detecting some encodings.
There is also the Kconv lib for making some encoding conversions.

I hope that helps,

Zev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,215
Messages
2,571,113
Members
47,716
Latest member
MiloManley

Latest Threads

Top