W3C home > Mailing lists > Public > public-i18n-geo@w3.org > November 2003

RE: JSP containers and default charset (was: Re DefaultCharset considered harmful)

From: Jungshik Shin <jshin@i18nl10n.com>
Date: Mon, 1 Dec 2003 11:11:20 +0900 (KST)
To: "Addison Phillips [wM]" <aphillips@webmethods.com>
Cc: public-i18n-geo@w3.org
Message-ID: <Pine.LNX.4.58.0312011100220.14447@jshin.net>

On Sun, 30 Nov 2003, Addison Phillips [wM] wrote:

Hi Addison,

> I think you're forgetting what happens to a JSP page. You can't just have
> the JSP container omit to mention the charset in the HTTP header because the
> encoding is important in the lifecycle of a JSP page: JSP pages are compiled
> into servlets. That is, they are turned into a small Java program that

You're absolutely right.  Therefore, the charset declaration in a JSP
file serves dual purposes. It indicates the character encoding of the
JSP file to the Java compiler (i.e. playing the same role as '-encoding'
option when invoking 'javac') and it also indicates in what character
encoding the generated html file should be served to the outside world.
Someone might argue that there need to be two separate 'directives' for
two roles, but I guess it's all right to overload pageEncoding directive.

> servlet (i.e. those String objects) to begin with. Parsing the HTML to look
> for a META tag is not a really reliable solution. So unless the file is

 Yup, I can't agree with you more.

> encoding, including UTF-8, wouldn't really solve the problem: people want to
> use legacy encodings from time to time as well. Setting the page encoding
> and content type should just be automatically part of what a JSP developer
> does in every page.

  I was labelling ASCII only files as UTF-8, which is why I didn't
realize that when I wrote the message.


Received on Sunday, 30 November 2003 21:11:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:28:00 UTC