ID: 36407 User updated by: memoimyself at yahoo dot com dot br Reported By: memoimyself at yahoo dot com dot br Status: Bogus Bug Type: XSLT related Operating System: Windows XP PHP Version: 5.1.2 New Comment:
This is NOT a bogus report. I explained in as much detail as possible what happens and yet I was reprimanded with "not enough information was provided for us to be able to handle this bug". What other information is there to provide? This is a script that runs on a test server that cannot be acessed over the internet, so I cannot provide you with a link to the script. According to your rules, I cannot submit more than 20 lines of code either, so I cannot reproduce a typical XML document or the whole XSL file, or even the complete PHP script, so I tried sending the bits that really matter (in my humble opinion). If you want to reproduce the problem, try this: (a) Transform ANY XML document encoded in UTF-8 with any XSLT stylesheet also encoded in UTF-8 with the tag <xsl:output encoding="utf-8"/>; (b) Output the result of the transformation, preceded by a content-type header specifying UTF-8 as the encoding, to a browser. I'll bet you anything you want that the output will NOT be UTF-8 as it should. If you prefer to disregard this report, suit yourself. I'm just trying to help. I guess we'll all be worse off if the bug is not fixed. But what can I do? Previous Comments: ------------------------------------------------------------------------ [2006-02-16 13:16:40] [EMAIL PROTECTED] Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. duped #36415 ------------------------------------------------------------------------ [2006-02-16 11:15:39] [EMAIL PROTECTED] Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Need xml doc and stylesheet you are using ------------------------------------------------------------------------ [2006-02-16 02:10:23] memoimyself at yahoo dot com dot br Description: ------------ I have an XSL file to transform XML documents; the XSL and all XML files are encoded in UTF-8. My PHP script is in a file also encoded in UTF-8. The data is retrieved from a database (MySQL 5) whose character set is UTF-8 and whose tables all have UTF-8 as their character set as well. All the strings in all the tables are duly encoded in UTF-8. Prior to data retrieval, the query 'SET NAMES "utf8"' is run to ensure that all i/o operations use the same character set (UTF-8). (Hope I've been thorough enough!) Now, my XSL file has the following top-level (child node of the document element, as it should be) element: <xsl:output encoding="utf-8" method="html"/> The transformation is performed by the transformToXML method of the XSLTProcessor class. When the code is run on a Windows server (Win XP, Apache 2.0.55,PHP 5.1.2), the result of the transformation is NEVER UTF-8 (always iso-8859-1), even if I chage 'method' to 'xml', and even if I use a 'media-type' attribute. When run on a Linux server (PHP 5.1.2 as well), everything goes well. Reproduce code: --------------- $xml = new DOMDocument('1.0', 'UTF-8'); $xml->loadXML($row->Report); $xsl = new DOMDocument('1.0', 'UTF-8'); $xsl->load($xsl_file); $proc = new XSLTProcessor; $proc->importStyleSheet($xsl); $report = $proc->transformToXML($xml); Expected result: ---------------- Output string should be encoded in UTF-8. Actual result: -------------- Output string in NOT encoded in UTF-8 and accented characters appear garbled. This problem only occurs under Windows. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36407&edit=1
