private static String parseEscapedSequence(StringCharacterIterator iterator) throws UnsupportedEncodingException {
        char c = iterator.next();
        if (c == '\\') {
            return new String(new byte[]{0, '\\'}, "UTF-8");
        } else if (c == '"') {
            return new String(new byte[]{0, '\"'}, "UTF-8");
        } else if (c == 'b') {
            return new String(new byte[]{0, '\b'}, "UTF-8");
        } else if (c == 'n') {
            return new String(new byte[]{0, '\n'}, "UTF-8");
        } else if (c == 'r') {
            return new String(new byte[]{0, '\r'}, "UTF-8");
        } else if (c == 't') {
            return new String(new byte[]{0, '\t'}, "UTF-8");
        } else if (c == 'U' || c == 'u') {
            //4 digit hex Unicode value
            String byte1 = "";
            byte1 += iterator.next();
            byte1 += iterator.next();
            String byte2 = "";
            byte2 += iterator.next();
            byte2 += iterator.next();
            byte[] stringBytes = {(byte) Integer.parseInt(byte1, 16), (byte) Integer.parseInt(byte2, 16)};
            return new String(stringBytes, "UTF-8");
        } else {
            //3 digit octal ASCII value
            String num = "";
            num += c;
            num += iterator.next();
            num += iterator.next();
            int asciiCode = Integer.parseInt(num, 8);
            byte[] stringBytes = {0, (byte) asciiCode};
            return new String(stringBytes, "UTF-8");
        }
    }