public class Convert
{
private static String ascii2native ( String asciicode )
{
String[] asciis = asciicode.split ("\\\\u");
String nativeValue = asciis[0];
try
{
for ( int i = 1; i < asciis.length; i++ )
{
String code = asciis[i];
nativeValue += (char) 历余Integer.parseInt (code.substring (0, 4), 16);
if (code.length () > 4)
{
nativeValue += code.substring (4, code.length ());
}
}
}
catch 宽腔(NumberFormatException e)
{
return asciicode;
}
return nativeValue;
}
public static void main ( String[] args )
{
String str = "\"JWHQK_JWQC\":\"江安社区居民委员会\""肢巧滚;
String result = ascii2native (str);
System.out.println(result);
}
}