Bug 3418 - unicode characters not preserved after a xslt transformation
Summary: unicode characters not preserved after a xslt transformation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: XML (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P2 Major
Assignee: Dave Hyatt
URL: http://perso.netpratique.fr/escoz/web...
Keywords:
: 5282 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-10 11:37 PDT by Romain Brestac
Modified: 2005-10-06 11:30 PDT (History)
4 users (show)

See Also:


Attachments
xml and xslt files used for the test (1.58 KB, text/plain)
2005-06-10 11:42 PDT, Romain Brestac
romain.brestac: review-
Details
proposed patch (2.82 KB, patch)
2005-09-17 14:27 PDT, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff
test cases (5.40 KB, application/octet-stream)
2005-09-18 01:35 PDT, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Romain Brestac 2005-06-10 11:37:24 PDT
An xml document is transformed using a xslt stylesheet.

In Safari, unicode characters from the source document like "י" display as "ֳ©".

Occurs only when output is set to "html" in the xslt.

Using the debug menu in Safari, the DOM TREE shows wrong characters.

Using in OS 10.4.1 terminal the following command outputs the right html (i.e with "יייי ... "):

xsltproc test.xml

My conclusion is that it is not a libxslt bug.

Documents used for the test:

-------- test.xml-----------
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>

<TEST>CHARACTERS IN SOURCE XML: ייייייייייייייייייייייייייייי</TEST>
----------------------------

-------- test.xsl-----------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" encoding="UTF-8"/>
    <xsl:template match="TEST">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            </head>  
            <body>
              CHARACTERS IN XSLT: ייייייייייי <br/> <xsl:apply-templates/>
            </body>
        </html>
  </xsl:template>

<xsl:template >
		<xsl:value-of select="." />
</xsl:template>

</xsl:stylesheet>
----------------------------
Comment 1 Romain Brestac 2005-06-10 11:42:00 PDT
Created attachment 2226 [details]
xml and xslt files used for the test
Comment 2 Romain Brestac 2005-06-12 00:39:58 PDT
Added  URL to a xml file that shows the problem
Comment 3 Romain Brestac 2005-07-15 09:32:14 PDT
Please have a look at this one .... I think it is a serious one and I doubt it is related to other XSLT bugs 
already known. Tested with webkit 412 and 412+

You can see it with a reduced example: 

http://perso.netpratique.fr/escoz/webkit/xslt_unicode.xml
Comment 4 Romain Brestac 2005-07-20 00:30:46 PDT
Comment on attachment 2226 [details]
xml and xslt files used for the test

Can anyone just tell me if this is a bug or if I am having hallucinations  ?
Comment 5 Martin Pittenauer 2005-07-22 13:37:43 PDT
This is also filed as <rdar://4110507>.
Comment 6 Darin Adler 2005-09-11 22:07:23 PDT
I think this is caused by bug 3809.
Comment 7 Alexey Proskuryakov 2005-09-15 11:25:47 PDT
I can still reproduce this now, with 3809 having been fixed in ToT.
Comment 8 Alexey Proskuryakov 2005-09-17 14:27:48 PDT
Created attachment 3928 [details]
proposed patch

The changes in CachedXSLStyleSheet could also be applied to CachedXBLDocument
below - I didn't modify that because I'm not sure if it is ever used, and
haven't got a test case.
Comment 9 Eric Seidel (no email) 2005-09-17 15:03:54 PDT
Comment on attachment 3928 [details]
proposed patch

The patch looks fine.  I'm not sure I fully understand the use of Decoder (I'm
not familiar with the class).  Regardless, before we can land this we will
require additional layout-tests to validate the changes.  Marking review:-
until the layout tests are attached (then you can remark this patch as ?).
Comment 10 Eric Seidel (no email) 2005-09-17 15:05:34 PDT
The test case attached is fine, but you shoudl turn it into a layout test (find the proper place in the layout 
test tree) and add it to your original patch.
Comment 11 Alexey Proskuryakov 2005-09-18 01:35:50 PDT
Created attachment 3929 [details]
test cases

(the original test case is included here)
Comment 12 Darin Adler 2005-09-19 15:50:48 PDT
Comment on attachment 3928 [details]
proposed patch

Looks good, r=me.
Comment 13 Vicki Murley 2005-09-21 14:05:58 PDT
I committed this fix.
Comment 14 Alexey Proskuryakov 2005-10-06 11:30:15 PDT
*** Bug 5282 has been marked as a duplicate of this bug. ***