
i am trying to read a txt file using java that has punjabi words but it is reading only english words? i am using the code below:
package unicode; import java.io.*;
public class ReadUTF8{
public static void main(String[] args)throws IOException{
int j=0; try{
BufferedReader i = new BufferedReader(new InputStreamReader
(new FileInputStream("c:\\unic.txt"),"UTF8"));
while (j<=2)
{
String str1 = i.readLine();
System.out.println("File text : "+ str1);
System.out.println("Reading Process Completly Successfully.");
j=j+1;
}
}
catch(UnsupportedEncodingException ue){
System.out.println("Not supported : ");
}
catch(IOException e){
System.out.println(e.getMessage());
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.