tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "eMantra Information" <emi...@emantratech.com>
Subject FW: jsp:include tag does not preserve encoding of the text
Date Sat, 03 Apr 2004 07:03:34 GMT


hi

I am using Apache web server and Tomcat 4.1.

I have a jsp:include tag (in say test1.jsp) and I am trying to include a data1.html file.
This html file contains UTF-8 encoded text. When this JSP is executed, the UTF-8 text is displayed
as garbage characters.


I have included following in the JSP
<%@ page contentType="text/html; charset=UTF-8" %> 


I have included following in the info.html
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">

However if I rename the info.html to data1.jsp and then include, the UTF-8 text gets displayed
correctly.

I suppose, the JSP engine does not interprete the content of the html file correctly according
to its encoding.
Where as if it is a .jsp, then it is int erpreting it appropriately?

Can anybody throw some lite on this?


regards
haresh
////////////////////////////////////////////////////////////////////////////////////
sample files.......

////////////////////////////////////////////////////////////////////////////////////
test1.jsp..........
<%@ page contentType="text/html; charset=UTF-8" %> 

<% 

response.setContentType("text/html; charset=UTF-8");

%>



<HTML>

<HEAD>

<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">

</HEAD>

<BODY>

<jsp:include page="data1.html" flush="true"/>

</BODY>

</HTML>

////////////////////////////////////////////////////////////////////////////////////
data1.html.....

<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<br>
हाती घ्याल ते तडीस न्या.
<br>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message