I have two instances of Tomcat 3.2.2, one running under Windows NT, the
other running under Linux.  The problem is identical in the two.

No matter what character set I use when saving my JSP files to disk, Tomcat
always assumes that they're in UTF8 format.  When I activate "DEBUG" logging
for "jasper.log", the following entry always appears when compiling a class:

Compiling with: -encoding UTF8 ...

(the "..." refers to other command-line parameters, such as "-classpath").

This has some unfortunate side effects: if I save my file as UTF-16, no JSP
tags are recognised are the resulting file is supplied "as-is" to the
browser.  I've looked at the ".java" file that Tomcat creates, and it
creates lines such as :

out.write("ÿþ< % @   p a g e   l a n g u a g e = \" j a v a \"   % >  \r\n
< % !  \r\n s t a t i c   i n t   h i t s   =   0 ;  \r\n % >  \r\n < h t m
l >  \r\n < h e a d >  \r\n < t i t l e > J S P   E x a m p l e < / t i t l
e >  \r\n < / h e a d >  \r\n < b o d y >  \r\n  \r\n < h 1 > J S P   E x a
m p l e < / h 1 >  \r\n  \r\n < p > H i t   c o u n t :   < % =   + + h i t
s   % >   �    é   x < / p >  \r\n  \r\n < / b o d y >  \r\n < / h t m l >
");

All accented characters are shown up as "é" or similar (instead of "�").
This has nothing to do with the <%@page contentType %> directive, as that's
handled correctly.  The problem occurs when Tomcat creates the ".java" file.

Is this a known bug?  Any workarounds?  Never seemed to have this problem
running the same code under Tomcat 3.2.1...

-Chris

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to