private static String escape(char c) {
        switch (c) {
        case '\b':
            return "\\b";
        case '\t':
            return "\\t";
        case '\n':
            return "\\n";
        case '\f':
            return "\\f";
        case '\r':
            return "\\r";
        case '\\':
            return "\\\\";
        }
        if (c < 0x20 || c > 0x7e) {
            String unicode = Integer.toString(c, 16);
            return "\\u" + "0000".substring(0, 4 - unicode.length()) + unicode + "";
        }
        return "" + c;
    }
Removes leading and trailing quotation mark from the given string. This method will properly unescape whatever
content is withing the string literal as well.

@param str The string to unquote.
@return The unquoted string.
vespajlib/src/main/java/com/yahoo/javacc/UnicodeUtilities.java