Hello Remy,
your are right! I found the difference very quickly.
JDTCompiler default Encoding is UTF8
ANTCompiler default Encoding is ISO-8859-1
Set correct javaEncoding parameter to default conf/web.xml and all is
working as 5.0.27 Release
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>javaEncoding</param-name>
<param-value>ISO-8859-1</param-value>
</init-param>
...
</servlet>
Nexttime I inspect first and then send a mail.
:-)
###
But the with my test.jspx example the following is strange:
The concrete http response is UTF-8 encoded
---
HTTP/1.1 200 OK
Content-Type: text/html;charset=UTF-8
Content-Length: 431
Date: Mon, 06 Sep 2004 07:15:25 GMT
Server: Apache-Coyote/1.1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Strict 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml1-strict.dtd">
<html xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns="http://www.w3.org/1999/xhtml"
lang="de"><head><title>Test</title></head><body>
ä<br/>
ö<br/>
ü<br/>
Ä<br/>
Ö<br/>
Ü<br/>
"Â "<br/></body></html>
-----
But at my Mozilla present the correct letters!
After I change the jsp directive to
<jsp:directive.page contentType="text/html;charset=ISO-8859-1" />
both Tomcat Release 5.0.27 and 5.5.1-dev (CVS HEAD)
the response was generated with the correct encoding ISO-8859-1.
---
HTTP/1.1 200 OK
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 429
Date: Mon, 06 Sep 2004 07:23:17 GMT
Server: Apache-Coyote/1.1
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Strict 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml1-strict.dtd">
<html xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns="http://www.w3.org/1999/xhtml"
lang="de"><head><title>Test</title></head><body>
ä<br/>
ö<br/>
ü<br/>
Ä<br/>
Ö<br/>
Ü<br/>
" "<br/></body></html>
----
my fault....
Thanx for the bug reporting hint, ;-)
Peter
Remy Maucherat schrieb:
> Peter Rossbach wrote:
>
>> Hello,
>>
>> I have test a small application with Tomcat 5.5 and CVS HEAD 5.5.1-dev
>> and with JDT something changed from 5.0.x to 5.5 with the JSP encoding.
>>
>> see example. test.jspx
>> The problem exit also with "normal" *.jsp with <%@ page
>> pageEncoding="ISO-8859-1" %>
>> I thing the JDT compiles with UTF-8, right ?
>>
>> Bug or what is wrong?
>
>
> I'm a little bit tired about that very popular way to present bug
> reports: "help, version XXX works while new version YYY is broken:
> something is wrong with version YYY".
>
> Nothing relevant has changed between 5.0.x and 5.5.x (you should know
> that, you're a committer), except the change of the source compiler.
>
> Now if you look in the code for JDT:
> if (ctxt.getOptions().getJavaEncoding() != null) {
> settings.put(CompilerOptions.OPTION_Encoding,
> ctxt.getOptions().getJavaEncoding());
> }
>
> The behavior is the exact same for the Ant compiler. So if it doesn't
> work for you, I think you should look into it.
>
> Rémy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
|