php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: psc at webcraft dot ch
New email:
PHP Version: OS:

 

 [2009-06-22 14:47 UTC] psc at webcraft dot ch
Description:
------------
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]?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-29 03:00 UTC] moriyoshi@php.net
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] svn@php.net
Automatic comment from SVN on behalf of moriyoshi
Revision: http://svn.php.net/viewvc/?view=revision&revision=286483
Log: * Fix bug #48645 (mb_convert_encoding() doesn't understand hexadecimal html-entities)
 [2009-07-29 04:44 UTC] moriyoshi@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 08:01:28 2024 UTC