tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 45406] Decoding URI encoded in UTF-16 does not work correctly.
Date Mon, 21 Jul 2008 10:41:17 GMT

--- Comment #11 from Ran Rubinstein <>  2008-07-21 03:41:16
PST ---
(In reply to comment #10)

Will, I'm sorry to drag this on, but I want to understand fully where I'm wrong
in this.

AFAIK, an ascii URL with one character represented in %-encoding such as does represent a legal UTF-16 encoded URL.

UTF-16 %-Encoding does not mean the client sends two bytes or a wchar for each
letter in the URL, but rather that it sends the URL in ASCII, except for the
parts of the query string are not ASCII and they are encoded using %-Encoding,
with the bytes there determined by the selected encoding (usually UTF-8).
This is also the behavior of java's built-in URLEncoder.encode()/decode()

So a UTF-16 encoded URL, can look like this:

and be legal.

Is my concept completely off-base?

If this is true, I see no reason for tomcat not to support this (except of
course that the architecture right now does not support it, since the
%-decoding and string building classes are separate - byteChunk expects, well,
a chunk of bytes, which it translates to a string according to the given
encoding. UDecoder translates the URL to this chunk of bytes.
I suggest that instead of this, when processing URLs/URI's tomcat will use a
combined approach that is compatible with the %-encoding rule that only
non-ascii characters are %-encoded.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message