Bug 31233 - jsp compile errors with Chinese Characters
Summary: jsp compile errors with Chinese Characters
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 5.5.1
Hardware: All All
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-15 04:31 UTC by steve shih
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments
a simple jsp which contains a few chinese chars with UTF8 encoded (373 bytes, text/html)
2004-09-15 06:50 UTC, steve shih
Details
another jsp which will cause compile error (744 bytes, text/plain)
2004-09-15 10:15 UTC, steve shih
Details
test jsp on tomcat 5.0 (34.97 KB, image/jpeg)
2004-09-15 16:06 UTC, steve shih
Details
test jsp on tomcat 5.5 with default javaEncoding (179.26 KB, image/jpeg)
2004-09-15 16:08 UTC, steve shih
Details
test jsp on tomcat 5.5 with javaEncoding set to ISO-8859-1 (36.17 KB, image/jpeg)
2004-09-15 16:09 UTC, steve shih
Details

Note You need to log in before you can comment on or make changes to this bug.
Description steve shih 2004-09-15 04:31:11 UTC
My jsp pages (which contains Chinese characters and encoded in UTF8) can be 
executed without any problems in Tomcat 4.1 and Tomcat 5.0. When I try to run 
these jsp pages in Tomcat 5.5, either it will result in compile errors or the 
Chinese characters can not be displayed correctly on the browser. Then I tried 
to replace jasper-compiler.jar and jasper-runtime.jar in Tomcat 5.5 with those 
in Tomcat 5.0 and all back to normal.
Comment 1 Remy Maucherat 2004-09-15 05:13:36 UTC
Can you provide a test case ?
Comment 2 steve shih 2004-09-15 06:50:52 UTC
Created attachment 12737 [details]
a simple jsp which contains a few chinese chars with UTF8 encoded
Comment 3 steve shih 2004-09-15 10:15:53 UTC
Created attachment 12739 [details]
another jsp which will cause compile error
Comment 4 Remy Maucherat 2004-09-15 13:59:48 UTC
I can't test the correctness of the characters right now, but I do not get any
compilation error with the second file. So this part of the report is bad.

Although I'm not the biggest expert in i18n, one of the pages seem wrong: it
does not include a page directive with the correct charset.

Last, you might want to try using the init-param of Jasper (in conf/web.xml) to
play with the encoding during the compilation.
        <init-param>
            <param-name>javaEncoding</param-name>
            <param-value>ISO-8859-1</param-value>
        </init-param>
Comment 5 steve shih 2004-09-15 16:06:40 UTC
Created attachment 12742 [details]
test jsp on tomcat 5.0
Comment 6 steve shih 2004-09-15 16:08:15 UTC
Created attachment 12743 [details]
test jsp on tomcat 5.5 with default javaEncoding
Comment 7 steve shih 2004-09-15 16:09:11 UTC
Created attachment 12744 [details]
test jsp on tomcat 5.5 with javaEncoding set to ISO-8859-1
Comment 8 steve shih 2004-09-15 16:15:37 UTC
I tested the second jsp on three environment settings and got three different 
results(please see the attatched images):

1. on tomcat 5.0 with default jsp compiler setting: ok
2. on tomcat 5.5 with default jsp compiler setting: compile error
3. on tomcat 5.5 with javaEncoding set to ISO-8859-1: display incorrectly
Comment 9 Remy Maucherat 2004-09-15 16:18:45 UTC
The is not productive at all. As I said: the syntax error does not occur for me.
So I will ignore this part of the report until I get a real test case.

As for the rest, since the generated source will very likely be the same (you
didn't compare, though), and the encoding is properly set on the compiler (you
can verify that in the compiler adapter source), the issue must rest with the
compiler itself. You have the option of using Ant as the compiler if JDT is the
issue (remove the JDT jar, and put ant.jar where the JDT jar was).

Supporting JDT is outside of Tomcat's scope, so I will resolve this report as
INVALID.