this.contentType = contentType.substring(0, beginCharsetParam); - String tail = contentType.substring(beginCharsetParam + 1); + // Trim the semicolon preceding the charset + int charsetSemi = this.contentType.lastIndexOf(';');
This is still not working for me. Now I can't do stuff like: setContentType("text/html; charset=utf-8; altcharset=iso-latin-1");
I don't know any current browser that uses this, but it is completely valid in RFC 2616.
can you describe how is this failing for you? The above setContentType results in a content type setting of
"text/html; altcharset=iso-latin-1"
with the response charset set to "utf-8".
I don't think I changed the previous behaviour in any way that would break things, but I might be wrong. :)
Let me know.
Jan
+ if (charsetSemi != -1) { + this.contentType = this.contentType.substring(0,
charsetSemi);
+ } + String tail = contentType.substring(beginCharsetParam); int nextParam = tail.indexOf(';'); String charsetValue = null; if (nextParam != -1) { this.contentType += tail.substring(nextParam); - charsetValue = tail.substring(beginCharsetValue,
nextParam);
+ charsetValue = tail.substring(BEGIN_CHARSET_VALUE,
nextParam);
} else { - charsetValue = tail.substring(beginCharsetValue); + charsetValue = tail.substring(BEGIN_CHARSET_VALUE); } // The charset value may be quoted, but must not contain any
quotes.
charsetValue = charsetValue.replace('"', ' ');
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]