Hello,

I have a jsp page with the following code at the top of the page, in order to display the page contents in UTF-8:

<%@ page contentType="text/html; charset=UTF-8" %>
<% response.setContentType("text/html; charset=UTF-8"); %>

In this page is a jsp:include tag that includes a static html file, the name of which is determined at runtime. This included file contains UTF-8 encoded characters, however these are not being displayed correctly in my browser (mozilla 1.5/debian), but as generic 'unknown unicode' chars. If I use an include directive instead however, the characters are displayed correctly. If I change the extension of the included file to .jsp so that it's compiled (just to see what happends) the characters still don't display because the .java file generated by Jasper has a response.setContentType("iso-8859-1") line inserted into it, which I've been unable to figure out how to change.

It seems likely that somewhere along the line, the content type of the included file (html or jsp) is being set and this setting is taking precedence over the page directives I have in the including page. I've tried setting everything I can think of to UTF-8 (file encoding, response and request objects), I've checked that the JSP compiler should be compiling using UTF-8 (I'm using tomcat 4.1.29) (even though this shouldn't really affect and included html file) but I can't seem to get the included file encoded correctly.

Does anyone know what setting is responsible for the response.setContentType line inserted by jasper, or have any further ideas that I could investigate ?

Many thanks,
..camilla


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to