Author: markt Date: Wed Aug 7 19:20:51 2013 New Revision: 1511448 URL: http://svn.apache.org/r1511448 Log: Part of fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48550 Change the default URIEncoding for all connectors to UTF-8.
Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java tomcat/trunk/webapps/docs/changelog.xml tomcat/trunk/webapps/docs/config/ajp.xml tomcat/trunk/webapps/docs/config/http.xml tomcat/trunk/webapps/docs/config/systemprops.xml Modified: tomcat/trunk/java/org/apache/catalina/connector/Connector.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Connector.java?rev=1511448&r1=1511447&r2=1511448&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Connector.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Connector.java Wed Aug 7 19:20:51 2013 @@ -24,6 +24,7 @@ import java.util.Locale; import javax.management.ObjectName; +import org.apache.catalina.Globals; import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleState; import org.apache.catalina.Service; @@ -77,6 +78,11 @@ public class Connector extends Lifecycle } finally { this.protocolHandler = p; } + + if (!Globals.STRICT_SERVLET_COMPLIANCE) { + URIEncoding = "UTF-8"; + URIEncodingLower = URIEncoding.toLowerCase(Locale.ENGLISH); + } } Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1511448&r1=1511447&r2=1511448&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Wed Aug 7 19:20:51 2013 @@ -169,6 +169,10 @@ <scode> Refactor char encoding/decoding using NIO APIs. (remm) </scode> + <update> + Change the default URIEncoding for all connectors from ISO-8859-1 to + UTF-8. (markt) + </update> </changelog> </subsection> <subsection name="Jasper"> Modified: tomcat/trunk/webapps/docs/config/ajp.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/ajp.xml?rev=1511448&r1=1511447&r2=1511448&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/config/ajp.xml (original) +++ tomcat/trunk/webapps/docs/config/ajp.xml Wed Aug 7 19:20:51 2013 @@ -226,8 +226,10 @@ <attribute name="URIEncoding" required="false"> <p>This specifies the character encoding used to decode the URI bytes, - after %xx decoding the URL. If not specified, ISO-8859-1 will be used. - </p> + after %xx decoding the URL. If not specified, UTF-8 will be used unless + the <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code> + <a href="systemprops.html">system property</a> is set to <code>true</code> + in which case ISO-8859-1 will be used.</p> </attribute> <attribute name="useBodyEncodingForURI" required="false"> Modified: tomcat/trunk/webapps/docs/config/http.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/http.xml?rev=1511448&r1=1511447&r2=1511448&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/config/http.xml (original) +++ tomcat/trunk/webapps/docs/config/http.xml Wed Aug 7 19:20:51 2013 @@ -225,8 +225,10 @@ <attribute name="URIEncoding" required="false"> <p>This specifies the character encoding used to decode the URI bytes, - after %xx decoding the URL. If not specified, ISO-8859-1 will be used. - </p> + after %xx decoding the URL. If not specified, UTF-8 will be used unless + the <code>org.apache.catalina.STRICT_SERVLET_COMPLIANCE</code> + <a href="systemprops.html">system property</a> is set to <code>true</code> + in which case ISO-8859-1 will be used.</p> </attribute> <attribute name="useBodyEncodingForURI" required="false"> Modified: tomcat/trunk/webapps/docs/config/systemprops.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=1511448&r1=1511447&r2=1511448&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/config/systemprops.xml (original) +++ tomcat/trunk/webapps/docs/config/systemprops.xml Wed Aug 7 19:20:51 2013 @@ -288,6 +288,9 @@ <li><code>org.apache.tomcat.util.http.<br/>ServerCookie.ALWAYS_ADD_EXPIRES</code></li> <li><code>org.apache.tomcat.util.http.<br/>ServerCookie.FWD_SLASH_IS_SEPARATOR</code></li> <li><code>org.apache.tomcat.util.http.<br/>ServerCookie.STRICT_NAMING</code></li> + <li>The <code>URIEncoding</code> attribute of any + <a href="http.html">HTTP connector</a> or + <a href="ajp.html">AJP connector</a>element.</li> <li>The <code>resourceOnlyServlets</code> attribute of any <a href="context.html">Context</a> element.</li> <li>The <code>tldNamespaceAware</code> attribute of any --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org