> @@ -510,14 +509,19 @@ > } > > 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. > + 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]