#17241 [Com]: encoding error?
| From: | dan at mojavelinux dot com | Date: | Mon, 28 Oct 2002 15:55:49 +0000 |
| Subject: | #17241 [Com]: encoding error? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-23562@lists.php.net to get a copy of this message | ||
ID: 17241
Comment by: dan@mojavelinux.com
Reported By: pipo@club.idecnet.com
Status: No Feedback
Bug Type: DOM XML related
Operating System: slackware linux 2.4.16
PHP Version: 4.2.0
New Comment:
Here is the main problem regarding this bug. If you want to enter data
into your xml document that is encoding in iso-8859-0 because the
encoding on your document is set to iso-8859-0, it screws up because
the internal encoding is always set to utf-8. This is fine, but the
input encoding is also always set to utf-8...if you want to enter
iso8859-1 data into the tree, there should be an option to set the
input encoding so that it converts it appropriately to utf-8.
Otherwise, the user is forced to do
iconv('ISO-8859-1', 'UTF-8', 'string') each time he/she wants to enter
data into the document. I believe you should be able to set the
expected input encoding and have it automatically convert it.
Previous Comments:
------------------------------------------------------------------------
[2002-09-17 01:00:00] php-bugs@lists.php.net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2002-08-14 10:40:44] chregu@php.net
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
------------------------------------------------------------------------
[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