to read unicode character in java
i am trying to read Unicode characters from a text file saved in utf-8
using java my text file is as follows
अ, अदेबानि
,अन, अनसुला,
अनसुलि,
अनफावरि,
अनजालु,
अनद्ला, अमा,
अर, अरगा,
अरगे, अरन,
अराय, अलखद,
असे, अहा,
अहिंसा,
अग्रं,
अन्थाइ,
अफ्रि, बियन,
खियन, फियन,
बन, गन, थन, हर,
हम, जम, गल, गथ,
दरसे, दरनै,
थनै, थथाम,
सथाम, खफ, गल,
गथ, मिख, जथ,
जाथ, थाथ, दद,
देख, न, नेथ, बर,
बुंथ, बिथ,
बिख, बेल, मम, आ,
आइ, आउ, आगदा,
आगसिर
i have tried with the code as followed
import java.io.*;
import java.util.*;
import java.lang.*;
public class UcharRead
{
public static void main(String args[])
{
try
{
String str;
BufferedReader bufReader = new BufferedReader( new
InputStreamReader(new FileInputStream("research_words.txt"), "UTF-8"));
while((str=bufReader.readLine())!=null)
{
System.out.println(str);
}
}
catch(Exception e)
{
}
}
}
getting out put as ???????????????????????? can anyone help me
No comments:
Post a Comment