JAVA中的编码格式问题

ISO8859系列;它们都是八位的字符集,ox00~ox7F仍与ASCII字符集保持兼容,大于ox7F的是各种拉丁字符或欧洲字符的扩展。

GB2312字符集;如果当前字节(八bit)小于ox80,则仍当它为英文字符,如果大于或等于ox80,则它和紧接着它的下一个字节构成一个汉字字符。

Unicode字符集;MS的NT/2000/XP,SUN公司的JAVA都用它做为默认的字符集。以英文为主要信息的互联网时代,它的使用,存储和传输,都及其浪费空间,所以才有了后来的UTF-8。

从JAVA源代码到屏幕显示正确的结果的具体过程...

“JAVA CODE(源代码)--JAVA 字节码--JAVA JVM--OS--显示设备”

JAVA乱码产生,一般由于八位“byte”跟十六位的“char”二者的转换引起。所以,在编码,解码过程中始终保持字符格式一致,就基本可以避免乱码的产生。

native2ascii [options] [inputfile [outputfile]]

[options]

-reverse 

Perform the reverse operation: convert a file with Latin-1 and/or Unicode encoded characters to one with native-encoded characters

-encoding encoding_name 
Specify the encoding name which is used by the conversion procedure. The default encoding is taken from 

System property file.encoding. The encoding_name string must be a string taken from the first column of 

the table below. 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值