tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Pilcher <i.pilc...@comcast.net>
Subject Re: HttpServletRequest.getCharacterEncoding -- useless?
Date Thu, 29 Jul 2004 21:01:14 GMT
Ian Pilcher wrote:
> Does the subject API ever return anything useful.  Using Tomcat 5, I
> can't get it to return anything but null.  Googling around, it seems
> that other servlet containers either always return null or always return
> some default value (usually ISO-8859-1).

OK, getCharacterEncoding isn't completely useless.  It is, however,
almost completely useless.  AFAICT, it only works if the client includes
the encoding in the Content-Type HTTP header.  If I manually create an
HTTP request with:

     Content-Type: application/x-www-form-urlencoded;charset=UTF-8

request.getCharacterEncoding returns "UTF-8".

Unfortunately, neither IE nor Mozilla do this.  There is a Mozilla bug
open:

     http://bugzilla.mozilla.org/show_bug.cgi?id=241540

I encourage anyone who is getting bitten by this issue to vote for this
bug.

-- 
========================================================================
Ian Pilcher                                        i.pilcher@comcast.net
========================================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message