IntelliJ Java IDE
The moose likes I/O and Streams and the fly likes Need Help ...to read text file.....??? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Reply Bookmark "Need Help ...to read text file.....???" Watch "Need Help ...to read text file.....???" New topic
Author

Need Help ...to read text file.....???

Sumeet Pandit
Greenhorn

Joined: Mar 09, 2002
Posts: 10
I am using the InputStreamReader class extended in my class. From there I used read() method to read the characters from a file which is having arabic text. From read method I am getting the character in ASCII format...which cann't possible to display on browser...as all browser display ANSI format...
Is someone having the idea..How to read the arabic text from file and display it on the browser?rolleyes:
Thanks in advance.... :


- Sumeet<br />-----------------------------------
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
Which browser are you using? You should be able to select a character encoding for an Arabic character set. I'm using IE 5 and i have a setting under the View menu:

And this is just the way the browser came installed. So I think you might be able to do the same thing.


Rob
SCJP 1.4
Sumeet Pandit
Greenhorn

Joined: Mar 09, 2002
Posts: 10
Thanks for ur quickest reply...

I set the same, but it is in vain..because from the method I get the ASCII format...I need help to get the data in ANSI format....
Plz reply.....
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
If the file really is encoded in some Arabic encoding, and you are really only getting 8 bit characters from read(), there's a problem, either with your read method, or with the encoding you are using.
How are you creating your InputStreamReader? you should be using the constructor that takes a String encoding paramater. Do you know the encoding name of the file?
Sumeet Pandit
Greenhorn

Joined: Mar 09, 2002
Posts: 10
Thanks for ur quickest reply...

I set the same, but it is in vain..because from the method I get the ASCII format...I need help to get the data in ANSI format....
Plz reply.....
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
post your code so I can take a look at what you are doing.
Sumeet Pandit
Greenhorn

Joined: Mar 09, 2002
Posts: 10
Originally posted by Rob Ross:
post your code so I can take a look at what you are doing.

Plz check your private mail box.
and Plz reply
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
sumeet
Please read the Javaranch Naming Policy and change your publicly displayed name to comply with our unique rule. Thank you for your cooperation.
Sumeet Pandit
Greenhorn

Joined: Mar 09, 2002
Posts: 10
Dear Ersin Eser,
Changed as per JavaRanch Naming Policy.
 
 
subject: Need Help ...to read text file.....???
 
Threads others viewed
Writing Hex Values to a file
Read Arabic text in Servlet
Java I/O Performance
Text files with arabic charcaters
Character Encoding
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture