php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52450 $DomDocumentObj->encoding should not affect xml declaration
Submitted: 2010-07-26 23:58 UTC Modified: 2011-01-12 13:29 UTC
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: giorgio dot liscio at email dot it Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.3.3 OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: giorgio dot liscio at email dot it
New email:
PHP Version: OS:

 

 [2010-07-26 23:58 UTC] giorgio dot liscio at email dot it
Description:
------------
hi

consider this code:

i want to set utf-16 as internal encoding for domdocument
because source data is utf-16 encoded

$doc->encoding = "UTF-16";

but my output for web is handled by:

iconv_set_encoding("internal_encoding", "UTF-16");
iconv_set_encoding("output_encoding", "UTF-8//TRANSLIT//IGNORE");

or can be handled by

echo iconv("UTF-16", "UTF-8", $xmldata);

so the output is utf-8 encoded but the xml declaration says:

<?xml version="1.0" encoding="UTF-16"?>

so $document->encoding property should work as how it works now, but it should not affect the xml declaration

in plus you should provide an alternative to set $xmlEncoding (make it non-readonly)

i'm sorry for my english... i hope you accept this request!
thank you


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-05 10:13 UTC] giorgio dot liscio at email dot it
hi, can you examine my request?
thank you
 [2011-01-12 13:29 UTC] rrichards@php.net
-Status: Open +Status: Bogus
 [2011-01-12 13:29 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

RTM
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC