code: public static String escape(String value, char quote) {
      Map<CharSequence, CharSequence> lookupMap = new HashMap<>();
      lookupMap.put(Character.toString(quote), "\\" + quote);
      lookupMap.put("\\", "\\\\");
  
      final CharSequenceTranslator escape =
          new LookupTranslator(lookupMap)
                  .with(new LookupTranslator(EntityArrays.JAVA_CTRL_CHARS_ESCAPE))
                  .with(JavaUnicodeEscaper.outsideOf(32, 0x7f));
  
      return quote + escape.translate(value) + quote;
    }
docs: Escape the string with given quote character.