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 Read non UNICODE character 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 "Read non UNICODE character" Watch "Read non UNICODE character" New topic

Read non UNICODE character

s Joshi

Joined: Sep 26, 2005
Posts: 12
My text file has a line like this: �this is a test�. I copied this line from MicroSoft Word Document. I am trying to read this file using IputStreamReader and then import this string in Oracle Database.

When I read this file, it reads this line like this: �this is a test�. How can I read this line just the way it is?

Any help is appreciated.
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

The problem is that a Word document is not a text document. If you read it with InputStreamReader, the weird characters Word uses for things like quotes don't match up with the plain text equivilents. Your choices are to either change the data file to be plain text or to filter out the weird characters and replace them in your program.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Read non UNICODE character
It's not a secret anymore!