For those who want to use servlet with two byte characters system such
as Big5 in Taiwan and BG in China, you may encounter problem with JSDK
in form processing. Here is the problem,

In javax.servlet.http.HttpUtils:

static private String parseName(String s, StringBuffer sb) {
  sb.setLength(0);
  for (int i = 0; i < s.length(); i++) {
    char c = s.charAt(i);
    switch (c) {
      case '+':
        sb.append(' ');
        break;
      case '%':
        try {
            sb.append((char) Integer.parseInt(s.substring(i+1, i+3),
                       16));
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException();
        }
        i += 2;
        break;
      default:
        sb.append(c);
        break;
    }
  }
  return sb.toString();
}

In decoding the % encoded character, it assume all characters are one
byte.

___________________________________________________________________________
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