字符编码
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(); } }
相关文章推荐
- SQL基础-->数据库事务(TRANSACTION)
- 《零年:1945 现代世界诞生的时刻》读后感
- centos7编译替换内核
- 上传附件插件的使用
- Spring Boot 系列 —— Hello World
- Android进阶笔记(二)Handler消息机制理解
- source insight配置(自动排版,多标签显示,注释,删除中文乱码)
- 正则表达式在PHP里的应用
- linux+nginx+mysql+php高性能服务器搭建
- 92. Reverse Linked List II LeetCode
- AVRWARE++开发笔记9:应用Atmel Studio学习C语言
- 蓝桥杯历届-穿越雷区
- AMD Polaris and Nvidia Pascal
- PL_sql之循环结构
- Python实现决策树算法 C4.5和ID3算法
- 内存经典案例分析
- 高德地图#import <MAMapKit/MAMapKit.h> file not found的解决办法
- 虚拟机Linux的联网问题
- <mvc:interceptor> 不起作用的一个解决方法
- 单链表常见习题及C语言实现(持续更新)