note 89483 added to function.html-entity-decode
| From: | marion at figmentthinking dot com | Date: | Tue, 10 Mar 2009 13:11:47 +0000 |
| Subject: | note 89483 added to function.html-entity-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151682@lists.php.net to get a copy of this message | ||
I just ran into the:
Bug #27626 html_entity_decode bug - cannot yet handle MBCS in html_entity_decode()!
The simple solution if you're still running PHP 4 is to wrap the html_entity_decode() function
with the utf8_decode() function.
<?php
$string = ' ';
$utf8_string = utf8_decode(html_entity_decode($string));
?>
By default html_entity_decode() returns the ISO-8859-1 character set, and by default
utf8_decode()...
http://us.php.net/manual/en/function.utf8-decode.php
"Converts a string with ISO-8859-1 characters encoded with UTF-8 to single-byte
ISO-8859-1"
----
Server IP: 208.69.120.35
Probable Submitter: 206.248.243.26
----
Manual Page -- http://www.php.net/manual/en/function.html-entity-decode.php
Edit -- https://master.php.net/note/edit/89483
Del: integrated -- https://master.php.net/note/delete/89483/integrated
Del: useless -- https://master.php.net/note/delete/89483/useless
Del: bad code -- https://master.php.net/note/delete/89483/bad+code
Del: spam -- https://master.php.net/note/delete/89483/spam
Del: non-english -- https://master.php.net/note/delete/89483/non-english
Del: in docs -- https://master.php.net/note/delete/89483/in+docs
Del: other reasons-- https://master.php.net/note/delete/89483
Reject -- https://master.php.net/note/reject/89483
Search -- https://master.php.net/manage/user-notes.php