You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jan Fnukal <jf...@efcon.cz> on 2001/05/14 09:55:20 UTC

Re: [Proposal] Default Encoding option for JSP/Tomcat in server.x ml or web.xml

> > For POST requests, the request parameters will be parsed in
> > the character encoding specified by the browser (as part of
> > the content type header).  If they did not, a new feature
> > in Servlet 2.3 lets you call request.setCharacterEncoding()
> > before trying to read any request parameters, if the app
> > knows what character encoding was used.
>
> I personally have never seen any browser specifing a character encoding
> while POSTing FORM data. In general it seems to use the encoding of the
page
> containing the form to encode the POST data but if the user chooses to
> change that it never tells the server in the POST request.
>
> Am I missing something?

You never know the encoding. Yo can guess from locale. The real problems
starts when for same laguage you have two possible encoding (eg. ISO-Latin2
and Cp1250) they are simular, but not the same. There is possible to add
selcet to form for user to choose. Or use hidden input tag, use critical
characters and find which encoding is used. Unfortunetly you never know, if
browser ecode hidden input tag.

The horror is when in parsing parameters are unknown characters replaced by
"?". Then there is no way back.

Honza