Why different URIEncoding in development vs production Tomcat connectors?

Having investigated customer issues with using Unicode-characters in query-parameter values used to call action endpoints (servlets) I’ve noticed that in the local development Confluence Server I have this:

<Connector ... URIEncoding="ISO-8859-1" .../>

but if I look at the production Confluence Server configurations, there I see this (download archive, unpack and look for conf/server.xml):

<Connector ... URIEncoding="UTF-8" .../>

Why the difference?

If I change ISO-8859-1 into UTF-8 on the local server.xml-file, on startup the server.xml-file seems to get overwritten and my setting reverts back to ISO-8859-1 and this messes up again the character decoding on the servlet code. I see this eg when looking at the query parameter injection (setter-method) on my servlet, for example something like “Övertid” comes in as decoded from ISO-8859-1 instead of UTF-8 that it was encoded with and of course that messes up the string usage in the servlet code.

This causes problems when I try to debug the UTF-8 encoded URIs from our front-end requests as I can’t make my development setup configuration to match that of the production server.

Any idea why this is so and how to get UTF-8 configured permanently on the Tomcat connector in the local development environment?

1 Like