码迷,mamicode.com
首页 > 其他好文 > 详细

字符编码

时间:2016-03-16 01:00:06      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

 

技术分享

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();
	}

}

 

字符编码

标签:

原文地址:http://www.cnblogs.com/tonglin0325/p/5281735.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!