Wiki source code of UTF-8 Support in Tomcat

Version 1.1 by Normann P. Nielsen on 2026/11/15 15:43

Hide last authors
Normann P. Nielsen 1.1 1 I have seen my URL's and links failing, due to missing UTF-8 support. Also, every upgrade of JIRA og Confluence replaces server.xml (but not setenv.sh)
2
3 === The Connector ===
4 Add URIEncoding="UTF-8" to the Connector as in:
5
6
7 {{code}}
8 <Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="80" address="77.243.52.139" minProcessors="5"
9 maxProcessors="75"
10 enableLookups="false" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000"
11 useURIValidationHack="false" URIEncoding="UTF-8"/>
12 {{/code}}
13
14
15
16 === The Java VM ===
17 Add -Dfile.encoding=UTF-8 to the JAVA_OPTS as in:
18
19
20 {{code}}
21 JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m $JAVA_OPTS -Djava.awt.headless=true -XX:NewSize=512m -Dfile.encoding=UTF-8"
22 {{/code}}
23
24 On windows (nooo!) is might be adding -Dfile.encoding=ISO-8859-1