there is a file named "dd.txt" in my disk, it's content is
\u5730\u7406
now ,when i run this program
public static void main(String[] args) throws IOException {
FileInputStream fis=new FileInputStream("d:\\dd.txt");
ByteArrayOutputStream baos=new ByteArrayOutputStream();
byte[] buffer=new byte[fis.available()];
while ((fis.read(buffer))!=-1) {
baos.write(buffer);
}
String s1="\u5730\u7406";
String s2=baos.toString("utf-8");
System.out.println("s1:"+s1+"\n"+"s2:"+s2);
}
and i got different result
s1:地理
s2:\u5730\u7406
can you tell me why? and how i can read that file and get the same result like s1 in chinese?