public String cnToUnicode(String cn) { char[] chars = cn.toCharArray(); String returnStr = ""; for (int i = 0; i < chars.length; i++) { returnStr += "\\u" + Integer.toString(chars[i], 16); } return returnStr; }
本文共 313 字,大约阅读时间需要 1 分钟。
public String cnToUnicode(String cn) { char[] chars = cn.toCharArray(); String returnStr = ""; for (int i = 0; i < chars.length; i++) { returnStr += "\\u" + Integer.toString(chars[i], 16); } return returnStr; }
转载于:https://www.cnblogs.com/znsongshu/p/10256993.html