note 52251 added to function.dom-domdocument-loadhtml
| From: | bigtree at DONTSPAM dot 29a dot nl | Date: | Tue, 26 Apr 2005 09:15:40 +0000 |
| Subject: | note 52251 added to function.dom-domdocument-loadhtml | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88551@lists.php.net to get a copy of this message | ||
Pay attention when loading html that has a different charset than iso-8859-1. Since this method does
not actively try to figure out what the html you are trying to load is encoded in (like most
browsers do), you have to specify it in the html head. If, for instance, your html is in utf-8, make
sure you have a meta tag in the html's head section:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
If you do not specify the charset like this, all high-ascii bytes will be html-encoded. It is not
enough to set the dom document you are loading the html in to UTF-8.
----
Manual Page -- http://www.php.net/manual/en/function.dom-domdocument-loadhtml.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52251
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52251&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52251&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52251&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52251&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52251&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52251&report=yes
Search -- http://master.php.net/manage/user-notes.php