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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2022 The PHP Group
All rights reserved.
Last updated: Sat May 21 21:05:46 2022 UTC