tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Pilcher <>
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

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

Ian Pilcher                              

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

View raw message