You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Edmund Urbani <em...@liland.org> on 2004/02/23 11:43:49 UTC

http request encoding & DefaultParameterParser

I had some problems with Turbine 2.3's DefaultParameterParser. Whenever I sent a
http request with "multipart/form-data" all german umlauts (=F6=E4=FC..) in text
fields were replaced by question marks. Looking into its source I found this
line:

setCharacterEncoding(enc !=3D null ? enc : "US-ASCII");

In my case the enc variable is always null (Mozilla does not seem to set that in
its requests), so the encoding always gets set to "US-ASCII". I am not sure,
this is the correct way to interpret the http request. I think ISO-LATIN-1
should be used instead (see http://www.w3.org/Protocols/HTTP/Body.html).

I changed the above line to 
setCharacterEncoding(enc !=3D null ? enc : "latin1");
for my webapps. Works fine for me. You might want to make the same modification
to the DefaultParameterParser.

Cheers,
 Edmund


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


RE: http request encoding & DefaultParameterParser

Posted by Eric Pugh <ep...@upstate.com>.
If you want to send in a patch, that would be great.  It definitly seems
like it should be configurable.

Eric

> -----Original Message-----
> From: Edmund Urbani [mailto:emu@liland.org]
> Sent: Monday, February 23, 2004 11:44 AM
> To: turbine-dev@jakarta.apache.org
> Subject: http request encoding & DefaultParameterParser
>
>
> I had some problems with Turbine 2.3's
> DefaultParameterParser. Whenever I sent a
> http request with "multipart/form-data" all german umlauts
> (=F6=E4=FC..) in text
> fields were replaced by question marks. Looking into its
> source I found this
> line:
>
> setCharacterEncoding(enc !=3D null ? enc : "US-ASCII");
>
> In my case the enc variable is always null (Mozilla does not
> seem to set that in
> its requests), so the encoding always gets set to "US-ASCII".
> I am not sure,
> this is the correct way to interpret the http request. I
> think ISO-LATIN-1
> should be used instead (see
> http://www.w3.org/Protocols/HTTP/Body.html).
>
> I changed the above line to
> setCharacterEncoding(enc !=3D null ? enc : "latin1");
> for my webapps. Works fine for me. You might want to make the
> same modification
> to the DefaultParameterParser.
>
> Cheers,
>  Edmund
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


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