code: static String escapeControlSymbols(String value) {
      if (value == null || value.isEmpty()) {
        return value;
      }
      StringBuilder result = null;
      for (int i = 0; i < value.length(); i++) {
        char ch = value.charAt(i);
        if (Character.getType(ch) == Character.CONTROL) {
          if (result == null) {
            result = new StringBuilder();
            if (i != 0) {
              result.append(value, 0, i);
            }
          }
          result.append(ESCAPING_MAP.get(ch));
        } else if (result != null) {
          result.append(ch);
        }
      }
      return result == null ? value : result.toString();
    }
docs: Escapes control symbols (Character.getType(ch) == Character.CONTROL).
  
  @param value String to be escaped
  
  @return escaped string if input value contains control symbols
  otherwise returns the input value