note 74777 added to function.dom-domdocument-loadhtml

From: Date: Fri, 27 Apr 2007 03:50:54 +0000
Subject: note 74777 added to function.dom-domdocument-loadhtml
Groups: php.notes 
Request: Send a blank email to php-notes+get-125906@lists.php.net to get a copy of this message
When using loadHTML() to process UTF-8 pages, you may meet the problem that the output of dom functions are not like the input. For example, if you want to get "Cạnh tranh", you will receive "Cạnh tranh". I suggest we use mb_convert_encoding before load UTF-8 page : <?php $pageDom = new DomDocument(); $searchPage = mb_convert_encoding($htmlUTF8Page, 'HTML-ENTITIES', "UTF-8"); @$pageDom->loadHTML($htmlUTF8Page); ?> ---- Server IP: 203.16.234.90 Probable Submitter: 125.212.137.5 ---- Manual Page -- http://www.php.net/manual/en/function.dom-domdocument-loadhtml.php Edit -- https://master.php.net/note/edit/74777 Del: integrated -- https://master.php.net/note/delete/74777/integrated Del: useless -- https://master.php.net/note/delete/74777/useless Del: bad code -- https://master.php.net/note/delete/74777/bad+code Del: spam -- https://master.php.net/note/delete/74777/spam Del: non-english -- https://master.php.net/note/delete/74777/non-english Del: in docs -- https://master.php.net/note/delete/74777/in+docs Del: other reasons-- https://master.php.net/note/delete/74777 Reject -- https://master.php.net/note/reject/74777 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#125906) next »