Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

Charset auto detector

Thread view: 
a.l@noos.fr - 06 May 2005 16:33 GMT
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
Alan Moore - 06 May 2005 20:16 GMT
>Hi folks,
>
[quoted text clipped - 7 lines]
>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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.