mygb2312code.java
来自「这是和jspcourseware相对应的案例。希望大家通过这个案例的学习能够系统」· Java 代码 · 共 31 行
JAVA
31 行
/*
* myGB2312code.java
*
* Created on 2007年3月26日, 上午9:55
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package util;
import java.io.*;
/**
*
* @author hyl
*/
public class myGB2312code {
/** Creates a new instance of myGB2312code */
public static String GB2312toUnicode(String s,String charset)throws IOException
{
// byte ba[] = new byte[s.length()];
// for(int i = 0; i< s.length(); i++){
// ba[i] = (byte)s.charAt(i);
// }
// return new String(ba,"GB2312");
String value = new String (s.getBytes(charset),"GB2312");
return value;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?