You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Marvin Addison <ma...@gmail.com> on 2011/08/01 17:18:40 UTC

Re: html meta http-equiv content-type not work ?

> I think you mean "any attempt to WRITE The RESPONSE".

I took some time to verify the effect I described,
https://github.com/serac/charset-test.  Reading data from the request
body coerces the encoding as I claimed.  Simply swap the order of the
filter-mappings in web.xml and post some unicode data to see for
yourself.  If ConsumeRequestFilter appears before
CharacterEncodingFilter, the posted data will not be treated as UTF-8.

> Spring's filter only sets the /request/ encoding, not the response.

Looks like it sets response encoding when forceEncoding == true:

		if (this.encoding != null && (this.forceEncoding ||
request.getCharacterEncoding() == null)) {
			request.setCharacterEncoding(this.encoding);
			if (this.forceEncoding) {
				response.setCharacterEncoding(this.encoding);
			}
		}

(3.0.5 source)

M

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org