您的位置:首页 > 其它

字符编码

2016-03-15 23:26 211 查看




import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

import org.omg.CORBA.portable.OutputStream;

//=================================================
// File Name       :	code_demo
//------------------------------------------------------------------------------
// Author          :	Common

//主类
//Function        : 	code_demo;
public class code_demo {

public static void main(String[] args) throws Exception {
// TODO 自动生成的方法存根
System.out.println("系统默认编码:"+System.getProperty("file.encoding"));		//获取系统当前的编码
File file = new File("/home/common/software/coding/HelloWord/HelloWord/b.txt");//路径
FileOutputStream out = new FileOutputStream(file);
byte b[] = "中国".getBytes("ISO8859-1");
out.write(b);
out.close();
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: