Re: JSP page directive contentType overriden by Apache tomcat?

KUROSAKA Teruhiko wrote:

>I see, so it's setLocale() that implicitly sets charset.
>That reminded me of my surprise when I read the servlet 2.3
>spec draft for the first time two years ago.  I wasn't
>comfortable with the idea of using  the locale to determine
>the charset.  I voiced this opinion to the spec lead
>but it was too late.

When I read Paul's and Addison's replies about setLocale() setting the 
character encoding, I thought exactly the same way as you. The relation 
between locales and character encodings are never 1:1. As such, IMHO, it's 
a (classic) bad design (unfortunately, still widespread. Hotmail, Yahoo 
mail and other web mail services are prime example of this.) to pretend 
that it is and to tie a locale to a particular character encoding. 
Especially considering that what JSP _usually_ emits (html, xml)  can 
represent the full repertoire of Unicode character set (I have NCRs in 
mind), I'm surprised to find that setLocale() sets the character encoding. 
Anyway,  making 'contentType' page directive take the precedence over 
setLocale() when it comes to setting the character encoding mostly solved 
the issue in the servlet 2.4.

Jungshik

Received on Sunday, 18 July 2004 03:03:15 UTC