Reading UTF - 8 Encoded Data in Java

In this section, you will learn what is UTF - 8 Encoded Data and how does that perform the work.


C:\nisha>java ReadUTF8
Enter File name : Filterfile.txt
File text : ??t h i s i s a f i l e
Reading Process Completly Successfully.


The above code written in the program creates a instance of the BufferedReader class using the InputStreamReader and FileInputStream classes to read data or contents from the specified file in the specified encoded data format that has been mentioned in above given line of the code(UTF8). This is thrown by the UnsupportedEncodingException exception if the given encoded data format does not support.

Download this example.

Share on Google+Share on Google+

Reading UTF - 8 Encoded Data in Java

Posted on: April 17, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles



Discuss: Reading UTF - 8 Encoded Data in Java   View All Comments

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
Manish Mannan
October 13, 2011
Example is not working please correct

Your example of reading java file with utf does not working test and publish it again thanks
Phyo Phyo Wai
April 30, 2012

how to show unicode word from database table in java?
Dung To
June 15, 2012
reviewing Java

read an UTF8 in java