Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read non UNICODE character

 
s Joshi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Pie
Posts: 9258
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic