#47305 [Com]: html_entity_decode and CP1252
| From: | polettog at gmail dot com | Date: | Thu, 05 Feb 2009 08:20:37 +0000 |
| Subject: | #47305 [Com]: html_entity_decode and CP1252 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-133521@lists.php.net to get a copy of this message | ||
ID: 47305
Comment by: polettog at gmail dot com
Reported By: poletto at gmail dot com
Status: Feedback
Bug Type: Strings related
Operating System: GNU/Linux 2.6 x86
PHP Version: 5.2CVS-2009-02-04 (snap)
New Comment:
I tried with this snapshot
Previous Comments:
------------------------------------------------------------------------
[2009-02-04 22:20:25] 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-04 13:44:54] 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('€', ENT_QUOTES, 'cp1252'));
var_dump(html_entity_decode('€', ENT_QUOTES, 'cp1252'));
var_dump(html_entity_decode('é', ENT_QUOTES, 'cp1252'));
var_dump(html_entity_decode('é', ENT_QUOTES, 'cp1252'));
var_dump(html_entity_decode('é', ENT_QUOTES, 'cp1252'));
?>
Expected result:
----------------
string(1) ""
string(1) ""
string(1) "é"
string(1) "é"
string(1) "é"
Actual result:
--------------
string(8) "€"
string(7) "€"
string(1) "é"
string(1) "é"
string(1) "é"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47305&edit=1