> What coud you say about reverse transformation ?

  public static String formEncode(String text) throws Exception {
    char[] c = text.toCharArray();
    StringBuffer buffer = new StringBuffer();

    for (int i = 0; i < c.length; i++) {
      if (
        (c[i] >= '0'&& c[i] <= '9') ||
        (c[i] >= 'A'&& c[i] <= 'Z') ||
        (c[i] >= 'a'&& c[i] <= 'z')
      ) {
        buffer.append(c[i]);
      } else if (c[i] == ' ') {
        buffer.append('+');
      } else {
        buffer.append('%');
        String hex = Integer.toHexString((byte) c[i]).toUpperCase();

        if (hex.length() < 2) {
          buffer.append('0');
        }

        buffer.append(hex);
      }
    }

    return buffer.toString();
  }

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to