Bug 11656 - UTF-8 encoding not supported correctly in included text file or JSP Document
Summary: UTF-8 encoding not supported correctly in included text file or JSP Document
Status: RESOLVED WORKSFORME
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Servlet & JSP API (show other bugs)
Version: 4.0.6 Final
Hardware: PC All
: P1 critical with 6 votes (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 8982 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-08-13 11:23 UTC by Andrew Harris
Modified: 2005-03-20 17:06 UTC (History)
1 user (show)



Attachments
WAR file demonstrating Bug 11656 (13.35 KB, application/octet-stream)
2002-08-13 11:24 UTC, Andrew Harris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Harris 2002-08-13 11:23:31 UTC
Text using UTF-8 encoding works fine in JSP Page but not when included from a 
text file or in a JSP Document. In all cases both charset and pageEncoding are 
set to "UTF-8". I have a small war file "utf8.war" which demonstrates the 
problems.
Comment 1 Andrew Harris 2002-08-13 11:24:34 UTC
Created attachment 2696 [details]
WAR file demonstrating Bug 11656
Comment 2 Reshat Sabiq 2002-10-12 13:51:11 UTC
I have the same problem in 4.1.9, and 4.1.12, when including texts from 
properties.
The problem doesn't exist in 4.1.8.
Comment 3 Mushtaq 2002-12-11 08:37:56 UTC
Hi,
I am encountering problem displaying utf-8 data in to my JSP page, I am using 
tomcat 4.0.6 have problem stroing data into db or retriving from the db, the 
data format is of utf-8 type, please do let me know if any suitable patch/jar 
or api to over come this issue in my site?

Do let me know this issue and fid?

Email me to m_mushu@yahoo.com

Mushtaq
Comment 4 mmccourt 2003-02-06 11:35:00 UTC
A similar (the same?) problem arises if you have a JSP that has UTF8 (or any 
other non-ISO8859-1) encoded content, and that statically includes another JSP 
that has the page directive contentType/charset and pageEncoding attributes set 
for the app.

JSP1.jsp:
--- begin ---
<%@ include file=JSP2.jsp %>
UTF8 content here
--- end ---


JSP2.jsp
--- begin ---
<-- this should set the pageEncoding for JSP1 to UTF-8 but it doesnt -->
<% page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
--- end ---

Comment 5 mmccourt 2003-02-10 14:30:15 UTC
Looks like bug 8982 is a duplicate of this.
Comment 6 Kin-Man Chung 2003-04-18 23:51:33 UTC
The test cases Andrew Harris provided are incorrect, as he is using jsp:include
instead of <%@ include %>, and the files he included are .txt files, not .jsp
files.  Of course the page directive that contains the pageEncoding and
contentType are not used in a .txt file.

I tried the test of mmccourt@iona.com on 4.1.18 and 5, and both works as
expected.  You can also examine the .java files to see that the contentType for
response is set correctely.

If there are still problems, please provide new test cases.
Comment 7 Kin-Man Chung 2003-04-18 23:54:56 UTC
*** Bug 8982 has been marked as a duplicate of this bug. ***
Comment 8 JeanLAMY 2004-05-25 08:23:23 UTC
Hi,

I have a similar problem with UTF-8.
I explain. I have a file (index.html) with a link to a servlet in it.
This file is the same on 2 servers with 1 with version 4.1.27 of Tomcat and 1
with 4.1.29. On the version 27 it work properly (URL is well encoded in UTF-8 as
I wanted and in version 29 the URL is not encoded in UTF-8. I'd like to add that
my servlet are the same...

Any ideas on this problem ?

thanks

Jean