写入的时候要转换字符,具体用哪个我也忘记了。。public static String getStr(String str){
try{
String temp_p=str;
byte[] temp_t=temp_p.getBytes("ISO8859-1");
String unicode=new String(temp_t,"GBK");
return unicode;
}
catch(Exception e){
System.out.println(e);
return "";
}
}
 
 public static String getStr1(String str){
 try{
      String temp_p=str;
  byte[] temp_t=temp_p.getBytes("GBK");
  String unicode=new String(temp_t,"ISO8859-1");
  return unicode;
 }
 catch(Exception e){
 System.out.println(e);
 return "";
 }
 }格式:
out.write(getStr("测试文字"));
或者
out.write(getStr1("测试文字"));自己测试一下吧。