Autodetect encoding / mojibake correction?

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

Hi,

On Wed, 25 Oct 2006 05:12:53 +0900, Cameron A. [email protected]
wrote:

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs