note 68055 added to function.dom-domdocument-construct
| From: | b dot schoppmeier at bas-consult dot de | Date: | Tue, 11 Jul 2006 20:53:42 +0000 |
| Subject: | note 68055 added to function.dom-domdocument-construct | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-114680@lists.php.net to get a copy of this message | ||
Handling of document encoding seems to be inconsistent:
I created a document, loaded a HTML file, tweaked it a bit and pushed it to the browser as in
$doc = new DOMDocument();
$doc->loadHTML($file);
/*
manipulate the document
/*
$outString = $doc->saveXML();
Text from the HTML file was ruined if it contained umlauts.
Creating the document with
$doc = new DOMDocument("1.0","ISO-8889-1");
solved this problem.
But, when I set attributes to DOMElements where the attribute value contained umlauts those values
still
appeared ruined.
Explicitly converting the attribute value to utf-8 as in
$element->setAttribute($name, utf8_encode($value));
solved that problem too.
----
Server IP: 66.163.161.117
Probable Submitter: 84.56.39.121
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.dom-domdocument-construct.php
Edit -- http://master.php.net/note/edit/68055
Del: integrated -- http://master.php.net/note/delete/68055/integrated
Del: useless -- http://master.php.net/note/delete/68055/useless
Del: bad code -- http://master.php.net/note/delete/68055/bad+code
Del: spam -- http://master.php.net/note/delete/68055/spam
Del: non-english -- http://master.php.net/note/delete/68055/non-english
Del: in docs -- http://master.php.net/note/delete/68055/in+docs
Del: other reasons-- http://master.php.net/note/delete/68055
Reject -- http://master.php.net/note/reject/68055
Search -- http://master.php.net/manage/user-notes.php