Bug #67988 [Opn]: htmlspecialchars() does not respect default_charset specified by ini_set
Edit report at https://bugs.php.net/bug.php?id=67988&edit=1
ID: 67988
User updated by: xela at xela dot org dot ua
Reported by: xela at xela dot org dot ua
Summary: htmlspecialchars() does not respect default_charset
specified by ini_set
Status: Open
Type: Bug
Package: Strings related
Operating System: CentOS Linux 6.5
-PHP Version: 5.6.0
+PHP Version: 5.6.2
Block user comment: N
Private report: N
New Comment:
Still exists in 5.6.2
Previous Comments:
------------------------------------------------------------------------
[2014-09-09 09:45:42] xela at xela dot org dot ua
Description:
------------
htmlspecialchars() does not respect default_charset specified by ini_set or php_value passed to
php-fpm, however it does while it is set by php.ini.
Test script:
---------------
<?php
ini_set('default_charset', 'cp1252');
var_dump(htmlentities("\xA3", ENT_HTML5));
var_dump(htmlentities("\xA3", ENT_HTML5, 'cp1252'));
var_dump(html_entity_decode("£", ENT_HTML5));
var_dump(html_entity_decode("£", ENT_HTML5, 'cp1252'));
Expected result:
----------------
Script should print:
string(7) "£"
string(7) "£"
string(1) "â"
string(1) "â"
Actual result:
--------------
Script printed:
string(0) ""
string(7) "£"
string(2) "£"
string(1) "â"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67988&edit=1
Thread (10 messages)