Tomcat URL Encoding Configuration

According to the Tomcat documentation, if URL decoding is not explicitly configured, it defaults to ISO-8859-1. Because of this, if Korean text is passed through GET without configuration, the text becomes garbled. On the other hand, when data is sent through POST, there is no issue because the input stream for the HTTP body is decoded as UTF-8 by default.

This problem can be solved by changing the encoding in the Tomcat configuration. In {Tomcat installation folder}/conf/server.xml, set URIEncoding to UTF-8 in the <Connector> element as shown below.

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" 
           URIEncoding="UTF-8" />

If you use mod_jk to connect with Apache, make the same change in the mod_jk configuration section.

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/>

References