Reading ISO Latin-1 Encoded Data in Java

In this section, you will learn about ISO Latin-1 Encoded Data. The ISO, it stands for International Organization for Standardization.

Reading ISO Latin-1 Encoded Data in Java



  The ISO stands for Organization for International Standardization. ISO is a standard characters set. The ISO Latin-1 is a supper set of the ASCII character set. It is the character set for Western European languages and an 8-bit encoding scheme in which every encoded character takes exactly 8 bits. The ISO-8859-1 standard also known as "Latin alphabet No. 1". 

Here, you will see how to use the ISO 8859-1 character set. This program takes the file name by user. If the given file exists then this program reads it's contents otherwise shows the appropriate message like: "File does not exist".

BufferedReader i = 
new BufferedReader(new InputStreamReader(new FileInputStream(file),"8859_1"));

Above  code has been written to create the instance of the BufferedReader class using InputStreamReader and FileInputStream classes to create buffer for reading contents from the specified file in standard ISO-1 format using the "8859-1", mentioned in the above line of the code.

Here is the code of program:


public class ReadEncodedLatin{
public static void main(String[] args)throws IOException

  BufferedReader in = new BufferedReader

(new InputStreamReader(;
  System.out.print("Enter File name : ");
String str = in.readLine();
File file = new File(str);

System.out.println("File does not exist");
BufferedReader i = new BufferedReader(new InputStreamReader
new FileInputStream(file),"8859_1"));
String str1 = i.readLine();
System.out.println("File Text : "+ str1);
  System.out.println("Reading Process Completly Successfully.");
catch(UnsupportedEncodingException ue){
System.out.println("Not supported : ");
catch(IOException e){


Output of the Program:


C:\nisha>java ReadEncodedLatin
Enter File name : Filterfile.txt
File Text : WelCome to RoseIndia.Net
Reading Process Completly Successfully.


 Download this example.

Share on Google+Share on Google+

Reading ISO Latin-1 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 ISO Latin-1 Encoded Data in Java   View All Comments

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image