File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes I/O and Streams and the fly likes utf-8 character file -check Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "utf-8 character file -check" Watch "utf-8 character file -check" New topic

utf-8 character file -check

Shankar sanjay
Ranch Hand

Joined: Sep 14, 2009
Posts: 117
I am having file myfile.txt, I want to know whether its utf-8 encoded or other then that. How can I check?

Sankar. S
Greg Charles

Joined: Oct 01, 2001
Posts: 2968

UTF-8 files often start with the three bytes (in hex) EF BB BF, but this is more a convention than a rule.
I agree. Here's the link:
subject: utf-8 character file -check
It's not a secret anymore!