private static char[] fourDigitHexString(char c) {
        char[] hex = new char[4];
        int in = ((c) & 0xFFFF);
        for (int i = 3; i >= 0; --i) {
            hex[i] = DIGITS[in & 0xF];
            in >>>= 4;
        }
        return hex;
    }
Do YQL+ escaping, which is basically the same as for JSON, of the
incoming string to the "quoted" buffer. The buffer returned is the same
as the one given in the "quoted" parameter.

@param in a string to escape
@param escaped the target buffer for escaped data
@return the same buffer as given in the "quoted" parameter
container-search/src/main/java/com/yahoo/search/yql/VespaSerializer.java