tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote Response.java
Date Mon, 13 Oct 2003 22:35:13 GMT
>   +        /*
>   +         * Remove the charset param (if any) from the Content-Type, and
use it
>   +         * to set the response encoding.
>   +         * The most recent response encoding setting will be appended
to the
>   +         * response Content-Type (as its charset param) by
getContentType();
>   +         */
>   +        int beginCharsetValue = BEGIN_CHARSET_VALUE;
>   +        int beginCharsetParam = contentType.indexOf(";charset=");
>   +        if (beginCharsetParam == -1) {
>   +            beginCharsetParam = contentType.indexOf("; charset=");
>   +            beginCharsetValue++;
>   +        }

Of course, this doesn't work if I do setContentType("text/html;
charset=utf-8");.

>   +        if (beginCharsetParam == -1) {
>   +            // no charset
>   +            this.contentType = contentType;
>   +            return;
>   +        }



Mime
View raw message