• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

determine encoding of a file

 
parth jeevan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All

I hope this question belongs here in the intermediate Java forum.I apologise if it doesnt.
I wanted to know if there is a way to find out the encoding(UTF-8 or ISO-8859-1 or some other) of a text file.If there's a way to determine the encoding by looking at the hex format of the text?

Ive googled this but found many ambiguous answers.

Thanks
Parth
 
parth jeevan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Just wanted to add that the reason i need this is these files are beeing sent to us by an external system and unfortunately they dont know what encoding they'r using.



Parth
 
Paul Clapham
Sheriff
Pie
Posts: 20980
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't always tell reliably, but people have written code that tries. I have heard that Jchardet does a pretty good job.
 
parth jeevan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the info Paul

Will check it out.

Parth
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic