public static String toUNICODE(String s)标签:编码,charAt,StringBuilder,String,toString,Unicode,sb,append,转化成 From: https://blog.51cto.com/u_5454003/6129457
{
StringBuilder sb=new StringBuilder();
for(int i=0;i<s.length();i++)
{
if(s.charAt(i)<=256)
{
sb.append("\\u00");
}
else
{
sb.append("\\u");
}
sb.append(Integer.toHexString(s.charAt(i)));
}
return sb.toString();
}