tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shankar Unni <>
Subject Tomcat URL decoding different from Java's URLDecoder?
Date Tue, 05 Jun 2007 22:27:58 GMT
We were playing around with a little JSP application, and trying to 
submit (and handle) Big5 characters.

(The real purpose was to exercise our primary app which sniffs HTTP 
traffic and "does stuff" with the raw data it captures - it sees the 
headers and body as sent over the wire.)

One odd thing we noticed was that when we sent in a single (two-byte) 
Big5 character in a form field (the page was already set to character 
encoding Big5), the encoded value sent in the URL was rather screwy:

The original character is (Big5) 0xAE 0x78.

The URL sent by IE said "%AEx". (!!)

Now Java's URLDecoder.decode(s, "Big5") doesn't like the above encoding: 
it insists that both characters be encoded, or neither - it ends up 
decoding this into "?x".

However, Tomcat actually returns the correct single chinese character 
from "request.getParameter("userid")".

Is it doing the URL decoding in a different way than Java's built-in URL 

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message