#17241 [Opn->Fbk]: encoding error?
| From: | chregu@php.net | Date: | Wed, 14 Aug 2002 14:40:44 +0000 |
| Subject: | #17241 [Opn->Fbk]: encoding error? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16774@lists.php.net to get a copy of this message | ||
ID: 17241
Updated by: chregu@php.net
Reported By: pipo@club.idecnet.com
-Status: Open
+Status: Feedback
Bug Type: DOM XML related
Operating System: slackware linux 2.4.16
PHP Version: 4.2.0
New Comment:
Properties of Dom Objects are read-only, only created at generation
time and therefore not really reliable...
The internal encoding of domxml is always utf8, could you please give a
short selfcontained example for the "add nodes from one document to
another"-problem?
But you gave the right solution, for having another encoding at
output.
chregu
Previous Comments:
------------------------------------------------------------------------
[2002-05-15 05:57:55] pipo@club.idecnet.com
I have found problems using documents with different encodings.
When I add nodes from one document to another
($docAItem->add_child($docB->root()), if the flag encoding property of
the target document has not been set when initially creating the
document (using functions xmldoc, xmldocfile, etc., not setting the
property manually with '$doc->encoding = "utf8"') then the encoding
translation is not done.
A possible workaround for this situation is to force the flag using
dumpmem with the optional encoding flag set. ie:
$docA = domxml_new_xmldoc(1.0);
$docARoot = $docA->add_root(root);
$docA = xmldoc($docA->dumpmem(0, UTF8));
It looks like the encoding property of the DomDocument object cant be
set manually.
Also, when creating a new DomDocument from scratch (with
domxml_new_xmldoc) the encoding property should be set to UTF8 as a
default, or allow a second optional parameter in the xmldoc function to
set the proper encoding.
byeer, pipo_
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17241&edit=1