You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Szegedi, Attila" <sz...@freemail.hu> on 2001/02/22 23:30:02 UTC

8859_1 hardcoded in one more place...

Hi!

I wondered why do all of my servlets receive wrong characters in form data,
and have found the answer by looking at
org.apache.tomcat.util.RequestUtil.java; it delegates the work of parsing
the POST-ed form data to javax.servlet.http.HttpUtils.parsePostData(), which
is evil as it takes only the input stream (that is, the bytes) as input with
NO ENCODING, so it blibdly assumes ISO-8859-1. Well, for large part of the
world outside USA, there are charsets that differ from ISO-8859-1. Here in
Hungary we're quite used to ISO-8859-2 (my personal favorite is UTF-8,
however).

The logic behind javax.servlet.http.HttpUtils.parsePostData() is clearly
broken: a method that is supposed to deal with characters while receiving a
byte stream. I think Tomcat should plainly not use it, but instead use
similar code that also takes an encoding parameter (which is available to
the relevant method in org.apache.tomcat.util.RequestUtil).

Cheers,
  Attila.