|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30964 Wrong display of special characters
Submitted: 2004-12-02 17:53 UTC Modified: 2004-12-02 21:21 UTC
From: pitchoune at vbulletin-fr dot org Assigned:
Status: Not a bug Package: XML related
PHP Version: 5CVS-2004-12-02 (dev) OS: Windows
Private report: No CVE-ID: None
 [2004-12-02 17:53 UTC] pitchoune at vbulletin-fr dot org
When you want to display phrases or words with special characters in ISO format by XML, the special characters are not displayed correctly.

Reproduce code:
error_reporting(E_ALL & ~E_NOTICE);

$xml = '<?xml version="1.0" encoding="ISO-8859-1"?><x>Test with some special characters: ? ? ? ? ?</x>';

$p = xml_parser_create();
xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, 0);
xml_set_element_handler($p, 'start_elem', 'end_elem');
xml_set_character_data_handler($p, 'cdata');
xml_parse($p, $xml, true);

function start_elem($parser, $tagname, $attributes){}

function end_elem($parser, $tagname){}

function cdata($parser, $data){ echo $data; }

Expected result:
Test with some special characters: ? ? ? ? ?

Actual result:
Test with some special characters: é è ù ô ?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-02 21:21 UTC]
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.

See #30951
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 08 22:05:53 2022 UTC