Home Java Example Java Io Reading UTF - 8 Encoded Data in Java
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

Reading UTF - 8 Encoded Data in Java

Advertisement
In this section, you will learn what is UTF - 8 Encoded Data and how does that perform the work.
C:\nisha>javac ReadAccessFile.java

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.

C:\nisha>

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.

Advertisements

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 17, 2007

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

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
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
unicode

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

read an UTF8 in java
DMCA.com