摘要: package service;import java.util.regex.Matcher;import java.util.regex.Pattern;public class CodeChange {/* * 把中文字符串转换为十六进制Unicode编码字符串 */ public static String stringToUnicode(String s) { String str = ""; for (int i = 0; i < s.length(); i++) { int ch = (int) s.charAt(i); if (ch > 255) 阅读全文
posted @ 2012-08-13 14:57 雲端之風 阅读(3481) 评论(0) 推荐(1) 编辑
摘要: package net.oschina.tester;public class ToUnicode { /** * @param args */ public static void main(String[] args) { System.out.println(toUnicode("汉字转换")); } public static String toUnicode(String s) { String as[] = new String[s.length()]; String s1 = ""; for (int i = 0; i < s.len 阅读全文
posted @ 2012-08-13 14:55 雲端之風 阅读(506) 评论(0) 推荐(1) 编辑