aspose file tools*
The moose likes I/O and Streams and the fly likes file, UTF8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "file, UTF8" Watch "file, UTF8" New topic
Author

file, UTF8

Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
1.I picked up this on net where it is said: if it falls into exception, then file is not UTF8.
2.It does not go into exception.
3. Until I figured that I should use cp1250 instead of UTF8, nothing was ok

Any advice how to catch wrong encoding exception ?



Searchable nature photo gallery: http://agrozoo.net/jsp/Galery.jsp?l2=en
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2854
    
  11

Well, there's an UnsupportedEncodingException that you could catch, but that's for encodings not supported by your system at all. Using a supported encoding that just isn't right for the file you're reading isn't going to cause an exception of any kind. Where did you see that?
 
wood burning stoves
 
subject: file, UTF8