tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Schuerig <mich...@schuerig.de>
Subject JDT-Compiler character encoding
Date Wed, 08 Sep 2004 14:07:26 GMT

I've tried the following for combinations of settings, where
jspx denotes the encoding declared and used in my jspx document, 
jsp-javaEncoding is declared in conf/web.xml, and jasper-out is the 
relevant line in the generated xxx_jspx.java.

(1)
jspx: ISO-8859-1
jsp-javaEncoding: not explicitly set
jasper-out:
      out.write("\tÀöÌÃ<84>Ã<96>Ã<9C>Ã<9F>\n");

(2)
jspx: UTF-8
jsp-javaEncoding: not explicitly set
jasper-out:
      out.write("\tÀöÌÃ<84>Ã<96>Ã<9C>Ã<9F>\n");

(3)
jspx: ISO-8859-1
jsp-javaEncoding: ISO-8859-1
jasper-out:
      out.write("\täöüÄÖÜß\n");

(4)
jspx: UTF-8
jsp-javaEncoding: ISO-8859-1
jasper-out:
      out.write("\täöüÄÖÜß\n");

Only (3) and (4) appear correctly in the browser as "äöüÄÖÜß" (german 
umlauts). I don't think setting the javaEncoding should be necessary 
here, but I may well be misunderstanding something.

Without any javaEncoding given, jasper produces UTF-8 encoded java 
source code and the JDT compiler supposedly accepts UTF-8 as its 
default input encoding. I haven't verified the latter.

There seem to be two possible causes for the incorrect output

the JDT compiler doesn't behave as advertised, i.e., it does not take 
UTF-8 as default input encoding. *Or* the JDT compiler produces 
character output in UTF-8 which is latter erroneously treated as 
ISO-8859-1.

Michael

-- 
Michael Schuerig           Contests between male toads over females are
mailto:michael@schuerig.de     often settled by the depth of the croak.
http://www.schuerig.de/michael/                    --John Maynard Smith

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message