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.
Created attachment 2696 [details] WAR file demonstrating Bug 11656
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.
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
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 ---
Looks like bug 8982 is a duplicate of this.
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.
*** Bug 8982 has been marked as a duplicate of this bug. ***
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