code: public static String encodeBackslashToAlphanumeric(char c) {
      if (isAlphanumeric(c) || c == '_') return ("" + c);
      String hex = Integer.toHexString(c);
      while (hex.length() < 4)
        hex = "0" + hex;
      return ("\\u" + hex);
    }
docs: Encodes a character to a backslash code (if not alphanumeric)