php.net |  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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: poletto at gmail dot com
New email:
PHP Version: OS:

 

 [2009-02-04 13:44 UTC] poletto at gmail dot com
Description:
------------
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:
---------------
<?php

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) "?"


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-04 22:20 UTC] jani@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [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: Sat Dec 21 16:01:28 2024 UTC