[Java] unicode to string

public static void main(String[] args) {
    try {
        String abc = "0043006F0077006D0061002E002E002E90808ACB";
        System.out.print(getString(abc));
    } catch (Exception e) {
        System.out.println("err");
    }
}

public static String getString(String strValue) {
    StringBuilder str = new StringBuilder();
    String temp;
    for (int i = 0; i < strValue.length(); i = i + 4) {
        temp =  strValue.substring(i, i + 4);
        str.append((char) Integer.parseInt( temp, 16 ));
    }

    return str.toString();
}
This entry was posted in Java. Bookmark the permalink.