Hi Christopher,

On Thu, 27 Jul 2017, Christopher Schultz wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Martin,

On 7/27/17 4:20 AM, Martin Nybo Andersen wrote:
Hi Christopher,

On Wed, 26 Jul 2017, Christopher Schultz wrote:

Martin,

On 7/26/17 7:08 AM, Martin Nybo Andersen wrote:
Hi list,

I've written some servlets with a url-pattern, that includes
non-US-ASCII letters (specifically the danish letter æ). This
works quite fine in tomcat 8.5.14 and previous versions.
However, I get 404 Not Found with versions 8.5.15 and
8.5.16.

If I get the mappings from the servlet's ServletRegistration,
then the non-US-ASCII letters are replaced by question
marks.

Exactly where are they replaced by question marks? This often
happens when your system default character set is something like
ISO-8859-1 and you are looking at a log file which had mangled your
characters... but the characters being used at runtime are
correct.

My url-mapping is /mælk/data, however, when I call getMappings()
I get /m?lk/data. If I set the url-mapping to /m%C3%A6lk/data
then getMappings() gives me the correct /mælk/data.

Are you seeing that in a debugger, a log file, etc? Where?

I wrote to stdout which ends up in catalina.out.

What about the decoded URL as it comes into Tomcat during a request?
Does that look okay to you?

I haven't checked that.

My guess is that tomcat supports url-encoded url-mappings by
calling UDecoder.URLDecode(). Trouble is that since revision
1793440 the string is treated as a US-ASCII string (see lines 344
and 345 of java/org/apache/tomcat/util/buf/UDecoder.java). Before
this revision the string was treated as either ISO-8859-1 or the
supplied encoding (UTF-8 in my case).

When you say "the supplied encoding" do you mean the declared encoding
of web.xml? Or the declared encoding of the HTTP request? Or some
other encoding?

I mean the argument `enc` defined on line 339 in java/org/apache/tomcat/util/buf/UDecoder.java

I've created the following bug report:
https://bz.apache.org/bugzilla/show_bug.cgi?id=61351

Okay, we can move the discussion there.

Will do. :-)


Kind regards,
Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to