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
IntroductionThe 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:
import java.io.*;
|
Output of the Program:
C:\nisha>javac ReadEncodedLatin.java C:\nisha>java ReadEncodedLatin Enter File name : Filterfile.txt File Text : WelCome to RoseIndia.Net Reading Process Completly Successfully. C:\nisha> |