Re: Re: [RFC] Use default_charset As Default Character Encoding
| From: | Yasuo Ohgaki | Date: | Thu, 31 Oct 2013 09:21:37 +0000 |
| Subject: | Re: Re: [RFC] Use default_charset As Default Character Encoding | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69981@lists.php.net to get a copy of this message | ||
Hi Joe,
On Thu, Oct 31, 2013 at 6:07 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> On Thu, Oct 31, 2013 at 5:31 PM, Joe Watkins <krakjoe@php.net> wrote:
>
>> How could you override them ??
>>
>
> It's in PoC patch.
> I made it while 5.5 was in beta, but it would work.
>
>
>> If they are removed then they cannot be referenced.
>>
>> If they are not being removed then nothing is being simplified ...
>>
>
> The most important objective is when you are using 'UTF-8' (I guess it's
> standard today)
> All you should do is
>
> default_charset='UTF-8'
>
> then PHP uses the setting anywhere it can apply. (e.g. htmlspecialchars,
> mbstring functions, etc)
> I have to work on functions, but php.ini related staff is in PoC patch.
>
I forgot to mention that it helps i18n applications also.
For example, preg and sqlite only accepts UTF-8 as MBCS char. Users may
write
if (ini_get('default_charset') !== 'UTF-8') {
$str = mb_convert_encoding($str, 'UTF-8');
}
preg, sqlite function calls here.
It simplifies things for sure.
I'll add these in RFC later.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net