Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001083 [Resin] major always 05-02-06 05:39 06-27-06 08:23
Reporter jrg745 View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.0.18
Summary 0001083: Encoding problem in resin jstl implementation
Description The jspx page below reads two files containing special characters like umlauts and the Euro character, parses them and displays the result. The first file is encoded using UTF-8, the second using ISO-8859-1. The result page uses ISO-8859-1.

The import is done using c:import, the document is parsed with x:parse and the as a result the variable that holds the original data is output using c:out and the parsed content using x:out.

If the original file is encoded as UTF-8 the result is nearly correct, only the Euro character is not displayed correctly. If the original file is encoded using ISO-8859-1 the result from c:out is correct, but the output from x:out is not readable. Surprisingly, in this case the Euro character is the only character that is displayed correctly.

We are using resin 3.0.18 under Windows XP.
Additional Information The jspx code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" [^]
          xmlns:c="http://java.sun.com/jsp/jstl/core" [^]
          xmlns:x="http://java.sun.com/jsp/jstl/xml" [^]
          version="2.0">
              
<jsp:directive.page contentType="text/html; charset=ISO-8859-1"/>
  <html>
    <body>
        <h1>UTF Test</h1>
          <c:import charEncoding="UTF-8" url="http://localhost:8080/test/testUTF.xml" [^] var="docUTF"/>
          <x:parse xml="${docUTF}" var="parsedDocUTF"/>
          


            <c:out value="${docUTF}"/>
          


          


            <x:out select="$parsedDocUTF/test"/>
          


        <h1>ISO Test</h1>
            <c:import charEncoding="ISO-8859-1" url="http://localhost:8080/test/testISO.xml" [^] var="docISO"/>
            <x:parse xml="${docISO}" var="parsedDocISO"/>
            


            <c:out value="${docISO}"/>
          


            


            <x:out select="$parsedDocISO/test"/>
            


    </body>
  </html>
</jsp:root>

The test file (the ISO-8859-1 version, the test uses a second file that is encoded using UTF-8):

<?xml version="1.0" encoding="ISO-8859-1"?>
<test>
  <testtext>äöüÄÖÜ€</testtext>
</test>

Attached Files

- Relationships

- Notes
(0001110)
jrg745
05-08-06 23:43

I now found out what really happens: in the ISO-8859-1 case, the file is imported by the c:import tag with the correct encoding. The content is stored in a string variable in Unicode format. The x:parse tag then parses this string and incorrectly applies the encoding from the encoding attribute in the xml header of the document.
The solution for the user is to encode the file in ISO-8859-1 but specify UTF-8 in the encoding attribute of the xml header. This is of course a workaround.
The correct implementation of the x:parse tag should ignore the encoding attribute because it always parses Unicode strings. So this is still a bug.
(If the charset value in the contentType attribute in the jsp is set to ISO-8859-15 even the Euro signs are displayed correctly.)
 
(0001313)
ferg
06-27-06 08:23

jsp/1cil
 

- Issue History
Date Modified Username Field Change
05-02-06 05:39 jrg745 New Issue
05-08-06 07:38 jrg745 Issue Monitored: jrg745
05-08-06 23:43 jrg745 Note Added: 0001110
06-04-06 11:37 anonymous Note Added: 0001260
06-04-06 11:37 anonymous Note Added: 0001261
06-04-06 11:37 anonymous Note Added: 0001262
06-04-06 11:37 anonymous Note Added: 0001263
06-04-06 20:43 ferg Note Deleted: 0001260
06-04-06 20:43 ferg Note Deleted: 0001263
06-04-06 20:43 ferg Note Deleted: 0001261
06-04-06 20:43 ferg Note Deleted: 0001262
06-07-06 07:30 anonymous Note Added: 0001269
06-07-06 07:31 ferg Note Deleted: 0001269
06-10-06 00:54 anonymous Note Added: 0001279
06-10-06 00:54 anonymous Note Added: 0001280
06-10-06 00:55 anonymous Note Added: 0001281
06-10-06 00:55 anonymous Note Added: 0001282
06-10-06 07:19 ferg Note Deleted: 0001279
06-10-06 07:19 ferg Note Deleted: 0001280
06-10-06 07:19 ferg Note Deleted: 0001281
06-10-06 07:19 ferg Note Deleted: 0001282
06-15-06 12:58 anonymous Note Added: 0001296
06-15-06 12:58 anonymous Note Added: 0001297
06-15-06 12:58 anonymous Note Added: 0001298
06-15-06 12:58 anonymous Note Added: 0001299
06-15-06 13:40 ferg Note Deleted: 0001296
06-15-06 13:41 ferg Note Deleted: 0001297
06-15-06 13:41 ferg Note Deleted: 0001298
06-15-06 13:41 ferg Note Deleted: 0001299
06-15-06 23:55 anonymous Note Added: 0001301
06-19-06 07:05 anonymous Note Added: 0001304
06-19-06 08:34 anonymous Note Deleted: 0001301
06-19-06 08:35 anonymous Note Deleted: 0001304
06-23-06 02:20 anonymous Note Added: 0001305
06-26-06 13:18 ferg Note Deleted: 0001305
06-26-06 14:25 anonymous Note Added: 0001309
06-26-06 17:30 ferg Note Deleted: 0001309
06-27-06 08:23 ferg Note Added: 0001313
06-27-06 08:23 ferg Assigned To  => ferg
06-27-06 08:23 ferg Status new => closed
06-27-06 08:23 ferg Resolution open => fixed
06-27-06 08:23 ferg Fixed in Version  => 3.0.20


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
66 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker