public static String jsDecode(String str) {
        if (null == str) {
            return null;
        }

        StringBuilder sBuilder = new StringBuilder(str.length());
        char[] cs = str.toCharArray();

        for (int i = 0; i < cs.length; ++i) {
            int c = cs[i] & 0xFFFF;

            if (c == '%') {
                if (cs[i + 1] == 'u') {
                    if ((i + 6) > cs.length) {
                        sBuilder.append(cs[i]);
                    } else {
                        try {
                            char cc = (char) Integer.parseInt(new String(cs, i + 2, 4), 16);
                            sBuilder.append(cc);
                            i += 5;
                        } catch (Exception e) {
                            sBuilder.append(cs[i]);
                        }
                    }
                } else {
                    if ((i + 3) > cs.length) {
                        sBuilder.append(cs[i]);
                    } else {
                        try {
                            char cc = (char) Integer.parseInt(new String(cs, i + 1, 2), 16);
                            sBuilder.append(cc);
                            i += 2;
                        } catch (Exception e) {
                            sBuilder.append(cs[i]);
                        }
                    }
                }
            } else {
                sBuilder.append(cs[i]);
            }
        }

        return sBuilder.toString();
    }
Parsing a string encoded with javascript's escape,
equivalent to javascript's unescape

@return Encoded string
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/web/common/BaseResult.java