日期:2014-05-20 浏览次数:20802 次
import java.io.UnsupportedEncodingException;
public class mainTest {
/**
* @param args
*/
public static void main(String[] args) {
String string = "解析①②";
try {
System.out.println(new String(string.getBytes("EUC-JP"), "EUC-JP"));
System.out.println(new String(string.getBytes("SHIFT-JIS"), "SHIFT-JIS"));
System.out.println(new String(string.getBytes("ISO-2022-JP"), "ISO-2022-JP"));
System.out.println(new String(string.getBytes("MS932"), "MS932"));
System.out.println(new String(string.getBytes("GBK"), "GBK"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}