File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

file, UTF8

 
Miran Cvenkel
Ranch Hand
Posts: 172
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?

 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic