Bug #67988 [Asn]: 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: Assigned
Type: Bug
Package: Strings related
-Operating System: CentOS Linux 6.6
+Operating System: Linux (all?)
-PHP Version: 5.6.4
+PHP Version: 5.6.5
Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
Still exists in 5.6.5
Previous Comments:
------------------------------------------------------------------------
[2014-12-20 10:43:36] xela at xela dot org dot ua
Still exists in 5.6.4
------------------------------------------------------------------------
[2014-12-08 15:29:43] xela at xela dot org dot ua
Still exists in 5.6.3
------------------------------------------------------------------------
[2014-11-16 22:48:04] xela at xela dot org dot ua
Still exists in 5.6.2
------------------------------------------------------------------------
[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)