Charset auto detector

Discussion in 'Java' started by a.l@noos.fr, May 6, 2005.

  1. Guest

    Hi folks,

    Do you know if there is a way to automaticly detect the charset from a
    bytes array ? In fact, I would like to decode a byte array, with the
    good charset interpretor, given that I do not know which charset was
    used to encode it.

    The CharsetDecoder class seems to have a "isAutoDetecting" boolean
    method : this means that there should exists a 'generic' charset
    decoder implementation which could auto detect the charset. Am I right
    ?


    Any suggestion would be appreciated,

    Thanks folks !


    Antoine Larcher
    , May 6, 2005
    #1
    1. Advertising

  2. Alan Moore Guest

    On 6 May 2005 08:33:26 -0700, wrote:

    >Hi folks,
    >
    >Do you know if there is a way to automaticly detect the charset from a
    >bytes array ? In fact, I would like to decode a byte array, with the
    >good charset interpretor, given that I do not know which charset was
    >used to encode it.
    >
    >The CharsetDecoder class seems to have a "isAutoDetecting" boolean
    >method : this means that there should exists a 'generic' charset
    >decoder implementation which could auto detect the charset. Am I right
    >?


    Unfortunately, that auto-detect feature is very limited. If you know
    you're reading Chinese text, but don't know which of the several
    Chinese encodings it was written in, you can use an auto-detecting
    "wrapper" Charset that figures it out for you. I think there's one
    for Japanese text as well, but there's no built-in universal
    auto-detecting Charset.

    I use this tool:

    http://glaforge.free.fr/wiki/index.php?wiki=GuessEncoding

    It only works with a limited set of Unicode and Western encodings, but
    it's perfect for my needs. If you need something with broader
    applicability, look for the CharDet package from Mozilla.
    Alan Moore, May 6, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lilmiss

    Overflow detector

    Lilmiss, Aug 2, 2005, in forum: VHDL
    Replies:
    1
    Views:
    2,434
    Ralf Hildebrandt
    Aug 2, 2005
  2. Andrew Thompson
    Replies:
    4
    Views:
    377
    Andrew Thompson
    Nov 8, 2004
  3. Gremlin

    Re: Infinite Loop Detector

    Gremlin, Feb 28, 2004, in forum: C++
    Replies:
    1
    Views:
    343
    Mike Wahler
    Feb 28, 2004
  4. linkswanted
    Replies:
    1
    Views:
    885
  5. optimistx

    javascript charset <> page charset

    optimistx, Aug 14, 2008, in forum: Javascript
    Replies:
    2
    Views:
    259
    optimistx
    Aug 15, 2008
Loading...

Share This Page