package com.basic.security.utils;
|
|
public class UnicodeUtil {
|
|
public static void main(String[] args) {
|
System.out.println(unicodeArrayToString("[24464,20462,28330]"));
|
}
|
|
public static String unicodeArrayToString(String unicodeArray) {
|
try {
|
if (unicodeArray == null) {
|
return "";
|
}
|
if (unicodeArray.startsWith("[") && unicodeArray.endsWith("]")) {
|
unicodeArray = unicodeArray.substring(1);
|
unicodeArray = unicodeArray.substring(0, unicodeArray.length() - 1);
|
String[] split = unicodeArray.split(",");
|
String str = "";
|
for (int i = 0; i < split.length; i++) {
|
str += Character.toString((char) Integer.parseInt(split[i]));
|
}
|
return str;
|
}
|
} catch (NumberFormatException e) {
|
e.printStackTrace();
|
}
|
return unicodeArray;
|
}
|
|
}
|