Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Charset auto detector

Reply
Thread Tools

Charset auto detector

 
 
a.l@noos.fr
Guest
Posts: n/a
 
      05-06-2005
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

 
Reply With Quote
 
 
 
 
Alan Moore
Guest
Posts: n/a
 
      05-06-2005
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.p...=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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LPG gas detector , smoke detector fire alarm system wholesale and OEM zcsecurity VOIP 3 09-20-2010 12:27 AM
LPG gas alarm detector, smoke detector fire alarm system OEM zcsecurity VOIP 1 09-20-2010 12:16 AM
javascript charset <> page charset optimistx Javascript 2 08-15-2008 12:42 PM
Auto Shipping Auto Shipping Scheduling:car moving auto transport linkswanted ASP .Net 0 02-16-2008 02:40 AM
Auto disc detector??? Jimbo Computer Support 6 08-16-2003 10:29 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57