|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47305 html_entity_decode and CP1252
Submitted: 2009-02-04 13:44 UTC Modified: 2009-02-12 01:00 UTC
From: poletto at gmail dot com Assigned:
Status: No Feedback Package: Strings related
PHP Version: 5.2CVS-2009-02-04 (snap) OS: GNU/Linux 2.6 x86
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: poletto at gmail dot com
New email:
PHP Version: OS:


 [2009-02-04 13:44 UTC] poletto at gmail dot com
html_entity_decode doesn't decode sp?cific CP1252 entities (characters in the 0x80-0x9F range) when specifying 'cp1252' charset, whereas it decodes succesfully other latin1 characters.

Reproduce code:

var_dump(html_entity_decode('&#x20AC;', ENT_QUOTES, 'cp1252'));
var_dump(html_entity_decode('&#8364;', ENT_QUOTES, 'cp1252'));
var_dump(html_entity_decode('&eacute;', ENT_QUOTES, 'cp1252'));
var_dump(html_entity_decode('&#233;', ENT_QUOTES, 'cp1252'));
var_dump(html_entity_decode('&#xe9;', ENT_QUOTES, 'cp1252'));


Expected result:
string(1) "?"
string(1) "?"
string(1) "?"
string(1) "?"
string(1) "?"

Actual result:
string(8) "&#x20AC;"
string(7) "&#8364;"
string(1) "?"
string(1) "?"
string(1) "?"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-04 22:20 UTC]
Please try using this CVS snapshot:
For Windows:

 [2009-02-05 08:20 UTC] polettog at gmail dot com
I tried with this snapshot
 [2009-02-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 16:01:32 2024 UTC