Bug #61354 [Opn->Ver]: htmlentities and htmlspecialchars doesn't respect the default_charset
From: laruence@php.net Date: Mon, 12 Mar 2012 05:36:17 +0000 Subject: Bug #61354 [Opn->Ver]: htmlentities and htmlspecialchars doesn't respect the default_charset References: 1 Groups: php.bugs Request: Send a blank email to php-bugs+get-168363@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61354&edit=1
ID: 61354
Updated by: laruence@php.net
Reported by: hufeng1987 at gmail dot com
-Summary: htmlentities and htmlspecialchars do not working
with default_charset ini set
+Summary: htmlentities and htmlspecialchars doesn't respect
the default_charset
-Status: Open
+Status: Verified
Type: Bug
Package: Strings related
Operating System: Linux/Windows/
PHP Version: 5.4.0
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2012-03-12 03:03:35] hufeng1987 at gmail dot com
Description:
------------
I am using php 5.4, i got a trouble with htmlspecialchars, htmlentities.
php 5.4 default charset is utf-8.
i thought htmlspecialchars, htmlentities may be using utf-8 as default encoding,
but even i configured default_charset in my php.ini , the htmlspecialchars and htmlentities still
stupid using utf-8.
this is a bad expirence, my project is a little big, htmlspecialchars using every where, almost 3
million called.
i had no chance to specified encoding by hand.
add encoding to each call of htmlspecialchars and htmlentities not possible, it is a huge change for
me .
for another solution, why not php let htmlspecialchars using encoding by php.ini settings?
is it a better way? is it friendly to users?
sorry for my bad english.
Test script:
---------------
<?php
$string = '<pre><p>ææ¯æµè¯</p></pre>';
echo htmlspecialchars($string);
echo htmlspecialchars($string, NULL, 'GB2312');
Expected result:
----------------
htmlspecialchars should using charset defined by php.ini
default_charset.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61354&edit=1
Thread (44 messages)
- Bug #61354 [Opn->Ver]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Ver->Nab]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Nab]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Nab]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Nab]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Nab]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Nab]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Nab]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Nab]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Nab]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
- Bug #61354 [Com]: htmlentities and htmlspecialchars doesn't respect the default_charset
| « previous | php.bugs (#168363) | next » |
|---|