Application servers may have different settings for character encodings. We strongly recommend UTF-8 where possible.
By
default, Tomcat uses ISO-8859-1 character encoding when decoding URLs
received from a browser. This can cause problems when Confluence's
encoding is UTF-8, and you are using international characters in the
names of attachments or pages.
To configure the URL encoding in Tomcat:
Step 1 - Configure connector:
- Edit
conf/server.xmland find the line where theCoyote HTTP Connectoris defined. It will look something like this, possibly with more parameters:
<Connectorport="8080"/> - Add a
URIEncoding="UTF-8"property to the connector:
<Connectorport="8080"protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443"URIEncoding="UTF-8"/> - If you are using mod_jk you should apply the same URIEncoding parameter as above to the AJP connector if you are using mod_jk, and add the following option to your Apache mod_jk configuration:
<Connector port="8009" protocol="AJP/1.3" URIEncoding="UTF-8"/> |
JkOptions +ForwardURICompatUnparsedStep 2 - Add Encoding Filter:The following filter settings need to be added in “web.xml” of {Tomcat_DIR}/conf folder:
<!-- A filter that sets character encoding that is used to decode -->
<!-- parameters in a POST request →
<filter>
<filter-name>setCharacterEncodingFilter</filter-name>
<filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<async-supported>true</async-supported>
</filter>
<filter>
<filter-name>Set Character Encoding</filter-name>
<filter-class>com.matrixone.servlet.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>setCharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Step 3 - Restart Tomcat.
Related Blogs:

Comments
Post a Comment