- How do I change how GET parameters are interpreted?
- How do I change how POST parameters are interpreted?
- What can you recommend to just make everything work? (How to use UTF-8 everywhere).
- How can I test if my configuration will work correctly?
- How can I send higher characters in HTTP headers?
- How to configure the BASIC authentication scheme to use UTF-8
You have to encode them in some way before you insert them into a header. Using url-encoding (
% + high byte number + low byte number) would be a good idea.
If a web application is configured to use the BASIC authentication scheme (e.g. configured with
<auth-method>BASIC</auth-method> in its web.xml file), it means that an instance of BasicAuthenticator will be automatically created and inserted into the chain of Valves for this web application (this Context), unless any other Authenticator valve has already been explicitly configured.
To enable support for UTF-8 in a BasicAuthenticator, you can configure it explicitly, by inserting the following line into the Context configuration file of your web application (usually META-INF/context.xml):
<Valve className="org.apache.catalina.authenticator.BasicAuthenticator" charset="UTF-8" />
If you do so, the BasicAuthenticator will append "charset=UTF-8" to the value of WWW-Authenticate header that it sends and will interpret the values sent by clients as UTF-8.
- Configuration Reference (Tomcat 9): Valves (Authentication), Context (Defining a context).
- Bug 61280
- Bug 66174
- Specifications (RFC 7617)