Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70682 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33654 invoked from network); 16 Dec 2013 22:39:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Dec 2013 22:39:03 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.54 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.54 mail-qa0-f54.google.com Received: from [209.85.216.54] ([209.85.216.54:63425] helo=mail-qa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/12-32483-6018FA25 for ; Mon, 16 Dec 2013 17:39:02 -0500 Received: by mail-qa0-f54.google.com with SMTP id f11so2024123qae.13 for ; Mon, 16 Dec 2013 14:38:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=C+2ajpvNvDVcMhTRrII+hrwh01rzLoCNfRgrVVMo8fA=; b=A4wEDxZIKGJ1Pv0jqNQvwUOIXH2SYu//lP46IR8/FyLzOgswCHDLflcSzCibLMorNJ 9Ncee+mcP6R4TvkUAIa+qujrhNy9bO4fcHiby3QITPda77RHqVkShk0cZGOyOz3HuuRe z2C2Fef0RnQFcxmMJ631oTeAsR/Ug5FiOjUpIsVQOgJYRPeA54vOJb6APVOWn4+3lugH bweSJqUDbMMSozZ25bopX0xhspZLnRmXNemVzhisq67TsL7cJuO3hKkgKDLEekWAVA0i Ab3sGjB+zmZwxUkirO4DyuceppWq/3ZWgzWmOmofuzI6wGfp9eBHMGHN/tAG+2wupOs/ 4Klw== X-Received: by 10.224.24.194 with SMTP id w2mr26634409qab.48.1387233539485; Mon, 16 Dec 2013 14:38:59 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.224.23.129 with HTTP; Mon, 16 Dec 2013 14:38:07 -0800 (PST) In-Reply-To: References: Date: Tue, 17 Dec 2013 07:38:07 +0900 X-Google-Sender-Auth: ZhFoxFfzV6IcZdsUdefHDEMUDjo Message-ID: To: Sherif Ramadan Cc: Adam Harvey , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c2d662577a2d04edae7a76 Subject: Re: [PHP-DEV] Re: Making addslashes() multibyte aware From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c2d662577a2d04edae7a76 Content-Type: text/plain; charset=UTF-8 On Tue, Dec 17, 2013 at 7:13 AM, Sherif Ramadan wrote: > On Mon, Dec 16, 2013 at 4:41 PM, Yasuo Ohgaki wrote: > >> On Tue, Dec 17, 2013 at 5:54 AM, Adam Harvey wrote: >> >> > On 16 December 2013 12:44, Yasuo Ohgaki 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. > There are many. SJIS, BIG5 and similar char encoding is used widely in East Asia. For instance, Windows uses SJIS as default char encoding for Japanese edition. I bet you never touch locale since you don't have to. I suppose those who have never touch locale will not be affected by this change. The issue here is unreliable locale system for certain locales... Locale is system dependent and we cannot do much for it. However, code uses locale is in PHP already. e.g. escapeshellcmd/escapeshellarg/fgetcsv or like. That's the reason why I decided to fix this with locale even if use of locale is not optimum.. Alternative solution is to use mbstring. It may be 5.6 only, but I don't mind much with this solution. In fact, I prefer this ;) Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c2d662577a2d04edae7a76--