|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16993 Characters with ascii>127 crash
Submitted: 2002-05-03 09:47 UTC Modified: 2002-06-02 18:51 UTC
From: rici at aporisk dot hu Assigned:
Status: Closed Package: Sablotron XSL
PHP Version: 4.2.0 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
14 - 8 = ?
Subscribe to this entry?

 [2002-05-03 09:47 UTC] rici at aporisk dot 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.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-03 10:00 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

 [2002-05-04 05:09 UTC] rici at aporisk dot hu
To better explain, here is an example source:

$xml = <<< END
<?xml version="1.0" encoding="ISO-8859-2"?>
<IMPORTANT>Very important ? ? ? </IMPORTANT>

$xsl = <<<END
<?xml version="1.0" encoding="ISO-8859-2"?>
<xsl:stylesheet xmlns:xsl="" version="1.0">
<xsl:output method="html"/>
<xsl:template match="ROOT">
  <B><xsl:value-of select="IMPORTANT"/></B>

$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-06 11:12 UTC] rici at aporisk dot hu
And I tried it with the command line version of php, and the result is the same.
 [2002-06-02 18:51 UTC]
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
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 17:01:33 2024 UTC