import java.io.*;
public class Hello{
public static void main(String[] args)throws IOException{
String str = "照相机";
OutputStreamWriter osw = new OutputStreamWriter(
new FileOutputStream("c:\\a.txt"),"BIG5");//用BIG5编码
osw.write(str,0,str.length());
osw.close();
osw = new OutputStreamWriter(
new FileOutputStream("c:\\b.txt"),"GB2312");//用GB2312编码
osw.write(str,0,str.length());
osw.close(); }
}
public class Hello{
public static void main(String[] args)throws IOException{
String str = "照相机";
OutputStreamWriter osw = new OutputStreamWriter(
new FileOutputStream("c:\\a.txt"),"BIG5");//用BIG5编码
osw.write(str,0,str.length());
osw.close();
osw = new OutputStreamWriter(
new FileOutputStream("c:\\b.txt"),"GB2312");//用GB2312编码
osw.write(str,0,str.length());
osw.close(); }
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货