static String unicode2String(String unicodeStr)
{
StringBuffer sb = new StringBuffer();
String str[] = unicodeStr.toUpperCase().split("U");
for (int i = 0; i < str.length; i++)
{
if (str[i].equals(""))
continue;
char c = (char) Integer.parseInt(str[i].trim(), 16);
sb.append(c);
}
return sb.toString();
}
public static String toUnicode(String s)
{
String as[] = new String[s.length()];
String s1 = "";
for (int i = 0; i < s.length(); i++)
{
as[i] = Integer.toHexString(s.charAt(i) & 0xffff);
s1 = s1 + "\\u" + as[i];
}
return s1;
}
public static String toUnicodeString(String s)
{
StringBuffer sb = new StringBuffer();
for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
if (c >= 0 && c <= 255)
{
sb.append(c);
}
else
{
sb.append("\\u" + Integer.toHexString(c));
}
}
return sb.toString();
}