Bug #16993 Updated: Characters with ascii>127 crash
| From: | k.schroeder@php.net | Date: | Sun, 02 Jun 2002 22:51:52 +0000 |
| Subject: | Bug #16993 Updated: Characters with ascii>127 crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-9240@lists.php.net to get a copy of this message | ||
ID: 16993
Updated by: k.schroeder@php.net
Reported By: rici@aporisk.hu
-Status: Open
+Status: Closed
Bug Type: Sablotron XSL
Operating System: Windows 2000
PHP Version: 4.2.0
New Comment:
This looks like an encoding problem.
Use <xsl:output method="html" encoding="utf-8"/>
or header("Content-type: text/html; charset=utf-8"); to give the right
encoding to your browser. This works for me.
Processing output direct with sabcmd from your xml and xsl documents
show the same as described from you. So I think, that's a sablotron
problem and not a PHP bug. Feel free to reopen, if my tip doesn't work
for you.
Regards, Kai
Previous Comments:
------------------------------------------------------------------------
[2002-05-06 11:12:38] rici@aporisk.hu
And I tried it with the command line version of php, and the result is
the same.
------------------------------------------------------------------------
[2002-05-04 05:09:02] rici@aporisk.hu
To better explain, here is an example source:
<?
$xml = <<< END
<?xml version="1.0" encoding="ISO-8859-2"?>
<ROOT>
<IMPORTANT>Very important ö ü é </IMPORTANT>
</ROOT>
END;
$xsl = <<<END
<?xml version="1.0" encoding="ISO-8859-2"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:template match="ROOT">
<B><xsl:value-of select="IMPORTANT"/></B>
</xsl:template>
</xsl:stylesheet>
END;
$arguments = array('/_xml' => $xml,'/_xsl' => $xsl);
$xh = xslt_create();
$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL,
$arguments);
echo $result;
?>
And, I think, the good result is: <B>Very important ö ü é</B>
But I always get: <B>Very important ö ü é</B>
------------------------------------------------------------------------
[2002-05-03 10:00:40] cynic@php.net
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".
------------------------------------------------------------------------
[2002-05-03 09:47:53] rici@aporisk.hu
Possible bug in xslt_process()
If in the source xml code are characters with ascii code greater than
127, for example some national characters (ö, ü, ...), they will not be
displayed correctly in the result after the transformation. Instead the
character I get two strange characters. For a specified source
character (>127) I always get specified characters. Of course, in the
xml tag I use the correct encoding attribute, for example ISO-8859-2.
Thanks.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16993&edit=1