|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48645 mb_convert_encoding() doesn't understand hexadecimal html-entities
Submitted: 2009-06-22 14:47 UTC Modified: 2009-07-29 04:44 UTC
From: psc at webcraft dot ch Assigned: moriyoshi (profile)
Status: Closed Package: mbstring related
PHP Version: 5.* OS: Debian Lenny
Private report: No CVE-ID: None
 [2009-06-22 14:47 UTC] psc at webcraft dot ch
When converting a hexadecimal html entity to UTF-8 with mb_convert_encoding, it get's converted to a broken unicode character (displayed in firefox as a small square). 

Reproduce code:
$v_html = "š";
echo $v_html;
echo mb_convert_encoding($v_html, 'UTF-8', 'HTML-ENTITIES');
echo html_entity_decode($v_html, ENT_COMPAT, 'UTF-8');

Expected result:
I'd expect it to output three times the same character, š.

At first as hexadecimal html entity, then two times in UTF-8.


Actual result:
š[something broken]?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-29 03:00 UTC]
This isn't actually a bug, as it wasn't implemented at all. (I don't know why the original implementer doesn't take account of it.)

 [2009-07-29 04:44 UTC]
Automatic comment from SVN on behalf of moriyoshi
Log: * Fix bug #48645 (mb_convert_encoding() doesn't understand hexadecimal html-entities)
 [2009-07-29 04:44 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 18:01:25 2019 UTC