RESOLVED FIXED 3418
unicode characters not preserved after a xslt transformation
https://bugs.webkit.org/show_bug.cgi?id=3418
Summary unicode characters not preserved after a xslt transformation
Romain Brestac
Reported 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> ----------------------------
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-
proposed patch (2.82 KB, patch)
2005-09-17 14:27 PDT, Alexey Proskuryakov
darin: review+
test cases (5.40 KB, application/octet-stream)
2005-09-18 01:35 PDT, Alexey Proskuryakov
no flags
Romain Brestac
Comment 1 2005-06-10 11:42:00 PDT
Created attachment 2226 [details] xml and xslt files used for the test
Romain Brestac
Comment 2 2005-06-12 00:39:58 PDT
Added URL to a xml file that shows the problem
Romain Brestac
Comment 3 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
Romain Brestac
Comment 4 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 ?
Martin Pittenauer
Comment 5 2005-07-22 13:37:43 PDT
This is also filed as <rdar://4110507>.
Darin Adler
Comment 6 2005-09-11 22:07:23 PDT
I think this is caused by bug 3809.
Alexey Proskuryakov
Comment 7 2005-09-15 11:25:47 PDT
I can still reproduce this now, with 3809 having been fixed in ToT.
Alexey Proskuryakov
Comment 8 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.
Eric Seidel (no email)
Comment 9 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 ?).
Eric Seidel (no email)
Comment 10 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.
Alexey Proskuryakov
Comment 11 2005-09-18 01:35:50 PDT
Created attachment 3929 [details] test cases (the original test case is included here)
Darin Adler
Comment 12 2005-09-19 15:50:48 PDT
Comment on attachment 3928 [details] proposed patch Looks good, r=me.
Vicki Murley
Comment 13 2005-09-21 14:05:58 PDT
I committed this fix.
Alexey Proskuryakov
Comment 14 2005-10-06 11:30:15 PDT
*** Bug 5282 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.