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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: christian dot ubu at gmail dot com
New email:
PHP Version: OS:

 

 [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 Oct 31 23:01:28 2024 UTC