Bytes("ISO8859-1"),"GBK")的实质
来源:互联网 发布:h3c交换机查看mac地址 编辑:程序博客网 时间:2024/05/21 22:58
import java.io.UnsupportedEncodingException; public class main { public static void main(String[] args) throws UnsupportedEncodingException{ byte [] b= new byte[]{(byte) 0xcc,(byte) 0xe1,(byte) 0xbd,(byte) 0xbb}; String s = new String(b,"ISO8859-1"); System.out.println(s); print(s.getBytes("ISO8859-1")); print(s.getBytes("GBK")); print(s.getBytes("UTF-16")); System.out.println(new String(s.getBytes("ISO8859-1"),"gbk")); String ss = "中文"; print(ss.getBytes("UTF-16")); print(ss.getBytes("ISO8859-1")); } static void print(byte [] b){ for(byte _b : b){ String s = Integer.toHexString(_b&0xff); if(s.length()==1){ s = "0"+s; } System.out.print(s + " "); } System.out.println(); } }
阅读全文
0 0
- Bytes("ISO8859-1"),"GBK")的实质
- java编码 utf-8 gbk iso8859-1
- 编码解码!(UTF-8,iso8859-1,gbk)
- iso8859-1 gb2312/gbk unicode utf-8
- GBK,UTF-8,ISO8859-1,unicode,base64
- [转]字符在utf-8,gbk,gb2312,iso8859-1下的编码实验
- GBK,UTF-8,和ISO8859-1之间的编码与解码
- 编码问题,UTF,ISO8859-1,unicode,ACSii,GBK之间的区别
- 数据库中GBk、GB2312、UTF-8、iso8859-1间的区别?
- GBK,UTF-8,和ISO8859-1之间的编码与解码
- GBK,UTF-8,和ISO8859-1之间的编码与解码
- GBK,UTF-8,和ISO8859-1之间的编码与解码
- GBK,UTF-8,和ISO8859-1之间的编码与解码
- GBK,UTF-8,和ISO8859-1之间的编码与解码
- GBK,UTF-8,和ISO8859-1之间的编码与解码
- 字符编码ASCII、Unicode、UTF-8、iso8859-1、GBK、GB2312
- 编码 ASCII ISO8859-1 GB2312 GBK GB18030 UNICODE UTF
- UTF-8,GBK,GB2312,iso8859-1字节比较
- RequestDispatcher
- sublime之类的编辑器:IndentationError: unindent does not match any outer indentation level
- Share directory w/ passwd in local network
- 【代码练习6】利用多线程生产消费问题实现熊吃蜂蜜问题
- PyTorch 特征
- Bytes("ISO8859-1"),"GBK")的实质
- SpringBoot入门-12(springboot配置servlet,利用代码实现)
- maven 打包错误解决:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.5:test
- Tomcat couldnotinitializeclasssun.awet.X11GraphicsEnvironment
- CppPrimer自学(3)公有继承
- this与super的区别
- scrollview和gridview嵌套使用的注意事项
- 为什么会需要消息队列(MQ)?
- Git指令集