users@servlet-spec.java.net

[servlet-spec users] Re: Easy UTF-8

From: Philippe Marschall <kustos_at_gmx.net>
Date: Sun, 13 Sep 2015 14:09:06 +0200

On 10.09.2015 13:08, Yannick Majoros wrote:
> Hi,
>
> 1. You can accept both (and that's mostly automatic and
> configuration-less), or just accept UTF-8 and throw BadRequestException
> when browser requests something else. I still can't see the point.

Nope that's not possible. ServletRequest#getParamter (for
GET/URL-Parameters) needs the URI encoding in advance to decode the
parameters.

> 2. That's a browser problem, that you can solve with some configurable
> default, and a standard specification for that can indeed help. But that's
> just a default when a browser fails to ask clearly (which modern one really
> does so nowadays?).

All of them.

> Stating that "configuring a Java EE web application to
> use UTF-8 has historically not been easy or doable in a portable manner"
> just isn't true.

You can't configure the encoding to use for URL decoding in a portable
manner. There are different options in the EG what the spec says what
the default URL encoding should be. As a consequence different TCK
compliant implementations have different defaults.

> I do agree with your 4th point, that would be cool.

So how do we proceed from there? So should I file a JIRA?

Cheers
Philippe