This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Problems while reading locale specific characters in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problems while reading locale specific characters in Java" Watch "Problems while reading locale specific characters in Java" New topic
Author

Problems while reading locale specific characters in Java

chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
Hi,

We are facing problems in reading locale specific characters from a file.
We are using the Buffered Reader to read the file, but the locale specific chars in the file are read as some wrong characters.

for Example the char: é is read as ý by the Buffered Reader. We are using the Jdk1.3.

Could you please help me in resolving this problem.

Many Thanks,

CHandra
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Are you using the same character encoding to read the file as it was written in?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
chandra kambham
Ranch Hand

Joined: Jun 09, 2008
Posts: 74
Yes.. we are writing to the file using a buffered Writer and reading using a bufered reader.
and to my surprise i found a strange thing here...
When i run my program in Windows OS it's reading the characters correctly.
But when i run my program in UNIX OS the locale specific characters are read differently.
 
 
subject: Problems while reading locale specific characters in Java
 
Similar Threads
My SCEA Part 1Study Notes
3 Features of Java for Internationalization
StreamTokenizer
File Reading
File transfer across two systems