我的程序如下,其中输出的汉字为乱码,请问大虾如何解决?
public static void main(String [] s){
File filename = new File("F:\\suncity.txt");
String filein="你好!hello!";
RandomAccessFile mm = null;
try {
mm = new RandomAccessFile(filename,"rw");
mm.writeBytes(filein);
}
catch (IOException e1) {
e1.printStackTrace();
}
finally{
if(mm!=null){
try {
mm.close();
}
catch (IOException e2) {
e2.printStackTrace();
}
}
}
}
public static void main(String [] s){
File filename = new File("F:\\suncity.txt");
String filein="你好!hello!";
RandomAccessFile mm = null;
try {
mm = new RandomAccessFile(filename,"rw");
mm.writeBytes(filein);
}
catch (IOException e1) {
e1.printStackTrace();
}
finally{
if(mm!=null){
try {
mm.close();
}
catch (IOException e2) {
e2.printStackTrace();
}
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货