Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reading "special" characters from a file

807606Apr 25 2007 — edited Apr 26 2007
I have a text file that I have created in Default Unicode font. In this file I have some "special" characters. These are the euro symbol, the British Pound symbol and 1 other character that I don't know the name of but looks like this �.

I have code that is trying to read this file in by creating a BufferedReader from a FileReader which was created on this file. I am getting a
sun.io.MalformedException when reading this file. It apears that the euro sign and these other character I don't know the name of are causing the problem. I know this because if I take them out of the file I don't get the error.

Any idea how I fix this problem ? I have been looking into UTF-8 and UTF-16 encoding but can't quite seem to figure it out.....

Thanks in Advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2007
Added on Apr 25 2007
2 comments
293 views