public static String unicodeRepresentation(String str) {
        StringBuilder b = new StringBuilder();

        for (char c : str.toCharArray()) {
            String s = Integer.toHexString(c).toUpperCase();
            while (s.length() <= 3) {
                s = '0' + s;
            }
            b.append("\\u").append(s);
        }
        b.append("\"");
        return '\"' + b.toString();
    }