You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/09/12 11:31:04 UTC

DO NOT REPLY [Bug 23128] - ServletRequest.setLocale() sets encoding even when already set

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23128>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23128

ServletRequest.setLocale() sets encoding even when already set





------- Additional Comments From makub@ics.muni.cz  2003-09-12 09:31 -------
I think that the second implementation mentioned in bug 6569 was the correct
one according to the spec, so you can just return back to it:

    public void setLocale(Locale locale) {
        [...]
        this.locale = locale;
        if ((this.encoding == null) && (this.context != null)) {
            CharsetMapper mapper = context.getCharsetMapper();
            this.encoding = mapper.getCharset(locale);
            if ((contentType != null) && (contentType.indexOf(';') < 0)) {
                contentType = contentType + ";charset=" + encoding;
            }
        }
    }