Bug #60714 [Opn]: htmlspecialchars() ignore default_charset value

From: Date: Thu, 12 Jan 2012 08:47:08 +0000
Subject: Bug #60714 [Opn]: htmlspecialchars() ignore default_charset value
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-166381@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60714&edit=1

 ID:                 60714
 Updated by:         rasmus@php.net
 Reported by:        mahatma at bspu dot unibel dot by
 Summary:            htmlspecialchars() ignore default_charset value
 Status:             Open
 Type:               Bug
 Package:            *Languages/Translation
 Operating System:   linux
 PHP Version:        5.4.0RC5
 Block user comment: N
 Private report:     N

 New Comment:

There was discussion. Simply changing the not-specified case to use the 
default_charset setting would break a lot of code. However, since it is a useful 
feature, it is supported through the empty string case as documented at 
http://php.net/htmlspecialchars


Previous Comments:
------------------------------------------------------------------------
[2012-01-11 22:50:11] cataphract@php.net

Yes, there's a BC break in 5.4 in this respect. You can make htmlspecialchars use
default_charset, but you'd still have to change all the calls to use the empty string as
charset.

I'm leaving this open for now, as this change was made without any discussion I remember.

------------------------------------------------------------------------
[2012-01-11 15:38:30] mahatma at bspu dot unibel dot by

Description:
------------
Since default charset changed, I got compatibility problem - htmlspecialchars() start to strip
cp1251 (or any non-unicode) national symbols and no way to change another default charset. But looks
like default_charset is provided for similar goals (and, ideally - charset= html detection too).

I suggest just to get default charset for htmlspecialchars() (and IMHO for htmlentities()) from
default_charset.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=60714&edit=1


Thread (6 messages)

« previous php.bugs (#166381) next »