Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgent -Need an API to identify the character encoding

 
Anu Manian
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Wondering if there are any JAVA APIs available to identify the character encoding of a content without the charset parameter on the content-type header. Please help needed immediately. I tried using NGramJ,

http://www.i18nfaq.com/chardet.html

http://www.jetbrains.com/idea/openapi/5.0/com/intellij/openapi/vfs/CharsetToolkit.html

I used this but the CharsetToolKit identifies only among UTF-8, UTF-16LE and UTF-16 not any other encodings like TIS-620 etc. I am new to this as well, so not sure whether I am doing it right. Please advise.

Also, if any samples of chardet would be appreciated.

One thing not sure, is when I send a message has Thai characters from Hotmail having my browser setting to Thai encoding(TIS-620) but my Hotmail account language is English and sent to one of my exchange accounts. In the outlook, the message looks gibbrish.

So I need the charset encoding detector to let me know what type of encoding is done on the content (as if you choose English as the language option, the Hotmail server doesn't have charset parameter in the content-type header) so that I can decode and re-encode to UTF-8.

Any immediate response would be appreciated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic