https://issues.apache.org/bugzilla/show_bug.cgi?id=45406





--- Comment #4 from Ran Rubinstein <[EMAIL PROTECTED]>  2008-07-16 06:57:15 PST 
---
(In reply to comment #3)
> Marking Invalid.
> 
> You aren't able to use utf-16 or ucs-2.  Period.
> 
> The RFC2616 protocol clearly declares the input stream to be an ASCII superset
> stream of otherwise opaque octets.  You can use any representation which is a 
> superset of ASCII and work out what character set you expect, such as UTF-8 
> or 
> ISO-8859-{any}.
> 
> The %xx syntax clearly defines one byte, and cannot express half a wchar.  If
> you wish to interpret the bytestream in this way, you will have to recombine
> them, but this would be ill advised, as "your protocol" can't necessarily be
> proxied at all.
> 

I accept the statement about RFC2616.
The sad fact is that I have 20,000+ Nokia phones deployed with a buggy browser
that encodes the request parameters in UTF-16LE whatever the page encoding.
Even if Nokia releases a fix, there's no way all of them will update their
firmwares.

My idea was to work around this by using:

request.setCharacterEncoding("UTF-16LE");

in a filter, after detecting the user-agent, and set
useBodyEncodingForURI="true". This doesn't work obviously because of the
situation described above with UDecoder.

My only solution now is to parse the parameters myself and use
URLDecoder.decode(param,"UTF-16LE"), which works correctly. This requires me to
use a HttpServletRequest subclass and override its getParameter* methods.

Thanks for the quick reply, If this is a performance issue, then there's really
no reason to degrade tomcat's general performance for a rare bug in a phone
browser, still, I've seen URLs encoded with non-ascii encodings before.

Ran.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to