Re: Re: Making addslashes() multibyte aware
On Mon, Dec 16, 2013 at 4:41 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> On Tue, Dec 17, 2013 at 5:54 AM, Adam Harvey <aharvey@php.net> wrote:
>
> > On 16 December 2013 12:44, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
>
> > I'll fix php_addslashes(). Therefore, any functions that use it
> > internally
> > > are affected. e.g. var_export(), etc. Users are not affected as long as
> > > they are using correct locale.
> > >
> > > Should I fix this from 5.3?
> >
> > This feels like it has the potential to be a really nasty implicit BC
> > break. I don't think we'd want to change default behaviour on any
> > stable branch, honestly.
>
>
> I cannot object this argument.
> There may be unexpected side effects.
> However, users will not be affected as long as they are using correct
> locale if locale system is not broken...
>
>
But honestly, how many users will set their locale to SJIS/BIG5 when
dealing with multibyte charsets like those? I typically never touch locales
when dealing with code that handles multibyte charsets (and that's becoming
more and more often these days), because it rarely makes sense. It makes a
lot more sense to me to deal with those issues on the intl/mb_* level and
as for serialization I hardly think that serialize() with addslashes is a
problem PHP needs to fix. More likely the correct and better fix is for
those developers to be more charset-conscious while making decisions about
how to handle serialized data after transport.
Thread (7 messages)