php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47368 XMLWriter::writeAttribute() doesn't display accented characters
Submitted: 2009-02-12 12:32 UTC Modified: 2009-02-12 18:35 UTC
From: christian dot ubu at gmail dot com Assigned:
Status: Not a bug Package: XML Writer
PHP Version: 5.2CVS-2009-02-12 (CVS) OS: CentOS release 5.2 (Final)
Private report: No CVE-ID: None
 [2009-02-12 12:32 UTC] christian dot ubu at gmail dot com
Description:
------------
XMLWriter::writeAttribute() doesn't display the value of the attribute with accented characters.

Reproduce code:
---------------
<?php

$w = new XMLWriter();
$w->openURI('php://output');
$w->startElement('test');
$w->writeAttribute('test?', 'test?');
$w->endElement();
$w->outputMemory();

?>

Expected result:
----------------
<test test?="test?"/>

Actual result:
--------------
<test test?="test&#x9005;&#10;&#x59;"/>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-12 18:35 UTC] rrichards@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

certain characters get written as character references within attribute 
values. That happens to one of them. Also make sure your encodings are 
correct because when run within UTF-8 env, the output is:
<test test?="test&#xE9;"/>
which is correct
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 15:01:32 2024 UTC