汉字转化为unicode
2010-08-31 15:32
211 查看
public static String gbkToUnicode(String s) throws Exception { if(s == null) return null; char []chars = s.toCharArray(); StringBuffer result = new StringBuffer(); String temp = ""; for(int i = 0;i < chars.length; i++) { temp = Integer.toHexString((int)chars[i]).toUpperCase(); result.append("//"+"u"); if(temp.length()!=4) { for(int j=0;j<4-temp.length();j++) { result.append("0"); } } result.append(temp); } return result.toString(); }
相关文章推荐
- unicode转化为汉字
- js 将汉字转化成unicode 16 编码 简单例子
- 将汉字转化为unicode编码
- \u Unicode和汉字转化
- C#实现将汉字转化为2位大写的16进制Unicode的方法
- ASP中汉字和Unicode的相互转化
- Unicode转化为汉字
- 将汉字转化成Unicode编码
- Unicode和汉字转化
- Unicode转化为汉字
- \u Unicode和汉字转化
- java 中汉字的转化成Unicode编码 的方法 JDK自带的native2ascii工具
- \u Unicode和汉字转化
- \u Unicode和汉字转化
- 将unicode编码转化为汉字输出
- Unicode转化为汉字
- 汉字与 unicode 编码相互转化
- 将汉字转化成Unicode编码(代码)
- [C#-Util]将汉字转化为2位大写的16进制Unicode
- \u Unicode和汉字转化