<%@ page
[ contentType="mimeType [ ; charset=characterSet ]" |
"text/html ; charset=ISO-8859-1" ]
[ pageEncoding="characterSet | ISO-8859-1" ]
%>
you have the contentType (which maybe is for the browser?) but not the
pageEncoding (which is maybe for Tomcat?)
I'm just guessing though.
> -----Original Message-----
> From: Ivan Montoro [mailto:[EMAIL PROTECTED]
> Sent: Sunday, April 04, 2004 2:14 PM
> To: [EMAIL PROTECTED]
> Subject: JSP include directive and UTF-8 files in Tomcat 5
>
>
> Hi everybody,
>
> I've found that with the default installation of
> Jakarta Tomcat 5.0.19, JSP include directive fails to
> add UTF-8 files to the generated .java source file. If
> you create a simple .jsp file with a <[EMAIL PROTECTED]
> directive, and include an HTML file saved as UTF-8,
> the resulting .java file contains the UTF-8
> representation of the ISO-8859-1 characters.
>
> I'm using the Unix "file" tool to see if the files
> I have are UTF-8 or not, so that's clear. I've
> tried the -Dfile.encoding=UTF-8 at setenv.sh and
> javaEncoding property in web.xml with no result.
>
> -------------------------------------------------
> sample.jsp (UTF-8)
> -------------------------------------------------
> <%@ page contentType="text/html;charset=UTF-8" %>
> <HTML><HEAD></HEAD><BODY> hell� w�rld! <%@ include
> file="sample.html" %> </BODY></HTML>
> -------------------------------------------------
> sample.html (UTF-8)
> -------------------------------------------------
> f�� b�r
> -------------------------------------------------
> resulting file (sample_jsp.java at work/ folder)
> -------------------------------------------------
> [...]
> out.write("<HTML><HEAD></HEAD><BODY>\n");
> out.write("hell� w�rld!\n");
> out.write("fóò bär\n");
> out.write("</BODY></HTML>\n");
> [...]
> -------------------------------------------------
> output in the browser
> -------------------------------------------------
> hell� w�rld! fóò bär
> -------------------------------------------------
> using "iconv -t ISO-8859-1" to convert .java file
> -------------------------------------------------
> out.write("<HTML><HEAD></HEAD><BODY>\n");
> out.write("hell wrld!\n");
> out.write("f�� b�r\n");
> out.write("</BODY></HTML>\n");
> -------------------------------------------------
>
> So, I believe that when you make a <[EMAIL PROTECTED] in
> Tomcat 5, the file is opened and read in ISO-8859-1
> encoding and then added to the .java source and
> compiled. I'm right? Is there any way to tell Tomcat
> to load files from <[EMAIL PROTECTED] in UTF-8?
>
> Thanks!
>
> Ivan
>
> ___________________________________________________
> Yahoo! Messenger - Nueva versi�n GRATIS
> Super Webcam, voz, caritas animadas, y m�s...
> http://messenger.yahoo.es
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]