标签:gbk and static port bsp import sys test out
package test; import java.io.UnsupportedEncodingException; /** * * @author jim */ public class Test { /** * @param args the command line arguments * @throws java.io.UnsupportedEncodingException */ public static void main(String[] args) throws UnsupportedEncodingException { // TODO code application logic here String str = "你好"; byte[] gbkBytes = str.getBytes("GBK"); String gbkStr = new String(gbkBytes, "GBK"); System.out.println(new String(gbkStr.getBytes("utf-8"))); } }
标签:gbk and static port bsp import sys test out
原文地址:http://www.cnblogs.com/Jim-william/p/6322422.html