The rules that cover this stuff are in the JSP 1.2 Spec, Section 2.10.1.

On Wed, 30 Jan 2002, Kevin Jones wrote:

> Date: Wed, 30 Jan 2002 17:41:48 -0000
> From: Kevin Jones <[EMAIL PROTECTED]>
> Reply-To: Tomcat Developers List <[EMAIL PROTECTED]>
> To: Tomcat-Dev <[EMAIL PROTECTED]>
> Subject: pageEncoding and Jasper
>
> If I add a
>
> <%@ page pageEncoding="windows-1256" %>
>
> (or any pageEncoding)
>
> What does Jasper do with this? I would expect this to be set on the
> content-type header but it's not. Jasper certainly parses the parameter
> and fails if I put an invalid value in there, I just can't get it to do
> anything. I can't use
>

The "pageEncoding" attribute specifies the encoding to be used to *read*
the page itself at compile time.


> <%@ page contentType="text/html; charset=windows-1256" %>
>

This is supposed to set the content type and character encoding on the
response page, as long as "windows-1256" is a valid character
set for your JDK.  It works for me with a page in the Struts example app
(HEAD branch) that starts:

  <%@ page contentType="text/html;charset=UTF-8" language="java" %>

and the generated servlet code has the following line near the beginning:

  response.setContentType("text/html;charset=UTF-8");

> I have to use
>
> <META HTTP-EQUIV="content-type" CONTENT="text/html;
> charset=windows-1256">
>
> Some of this might seem like a user question, but I'm more concerned
> about how Jasper works and what it should be doing.
>

AFAICT, Jasper is doing the right thing.  Whether IE properly deals with a
character encoding attached to the content type like this (as the HTTP
spec requires) is another question entirely.

> Thanks,
>
> Kevin Jones
> Developmentor
> www.develop.com
>

Craig McClanahan



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to