Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103538 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71672 invoked from network); 2 Dec 2018 18:54:22 -0000 Received: from unknown (HELO mout.gmx.net) (212.227.15.15) by pb1.pair.com with SMTP; 2 Dec 2018 18:54:22 -0000 Received: from [192.168.2.103] ([79.222.37.159]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LpKrt-1h7jks1dfJ-00f9xa; Sun, 02 Dec 2018 16:19:15 +0100 To: Stanislav Malyshev , Pierre Joye Cc: PHP internals References: <3081944c-4e55-f303-fddd-7f03cff04034@gmail.com> Message-ID: <7c71893f-9807-d4b1-99eb-b9ff7652a67c@gmx.de> Date: Sun, 2 Dec 2018 16:19:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:JtUvxhk5P9hnrL6RbHSgK4Mi6cHYFLtrqmICohhCxwWcnhgcyRQ 4aD4yU01PDVmrnNM1vJz2PXD/roHS6X0iTpWO5gOYZ3KwYuvd99IQD/Evw5OwuY8Y46WHNR uHi2lxXQhTsa1a3NeBCzxt48LFau4o2B8zT8uG2KaD7CmwRX2UlNJHLIfdK6L32zbUUD5Ob pAn+177tB8UkZ5divHVsg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:BwUnlz4r9Y8=:ZWucx2CXLgJcb4HxjJFy9t ZzYtc3QA0EUsM13NmI3Ob2TSYnIurbeaLxcU6ymgPoIlgoHbbYfAVSMGqM4Es3qeiOb9k5HNE kR8JTiUMCXwATF3Nji9yKVUfCIgBmp8w9lg1qK1VTOUZTlXXR+315X2sUKY7OwuuKU1aI9L7F bqWcIqw0+kIuU+D+eD7JSP0HYOPLlPfoQwvTxa98QmyNz2NN73aLTxIXk9ycAdhNbz4n6ZW5Z OKDhNGsl0uHZgp3HougEV5Z/qCmtf/r+NafGDiKZTnSrQSn7PFNaByrzLkCK9cqzXBAq9GO+B pB9BWfJ6bt1RTDcvwYNkePA2yqvD/gnUnxVB42VwtYs+4NhFkk2z0L2PflhYvPKf4wo93bOko RNYOQWfAI7LivfPh5DO4Off/p1zD2iKYXE309D5QGuUDxK2TMUnoCdC2IPws6e7O27TXdvEzA uCRy7ceTh3Wm11No+emgiwiKCD8rao+b7jQznKe+SUFN8V0P6GqwvEPwP36BSQ79xf9OGmvG5 cJl0DOfDh77iJquhCzIe1YXF+LWw5C3em8POhDZkmreRMW3rwBYgihlwbYBFdIBApzn3YTWRq x9m5744R+kjDlJduJ6jnC9YtJE1HyWF+ii5zlzO4kjjyaXX2o2DgtmFEKIkc4ZeZ43s+Ehuc8 hMDci0zeUB+Iuhu2LbnvsyAe00+Tb+Y46MP+4dxHcm06Mf5g5QOJcsQ25bMJGwNC1jj2su6OC VtS2XM5kcxbtI97w2TJZtZPTvHRCPUdjM3SRbi+/hyTLTBWCIR+jTQLLSOWTxa0m7Y2g7IqJH cN9EGF5cbgpgYXheQtopwoudpTtxX5WR+mtBc/0h9lQ7o7MmLxdsbTAubujPRYtVSwl+5xhii DOxvjSRXFaFVhKGpfTb+2pFFgpHYQpiKXod7WuR9P5YEZvamNVbLgJMe2EPS61 Subject: Re: [PHP-DEV] [RFC] Kill proprietary CSV escaping mechanism From: cmbecker69@gmx.de ("Christoph M. Becker") On 30.09.2018 at 22:17, Stanislav Malyshev wrote: >> If we cannot eventually get rid of the escaping for CSV reading (note >> that I proposed to keep the possibility to use it until PHP *9*), I >> don't think that we should remove it for CSV writing either, since that >> would make SplFileObject::setCsvControl() and ::getCsvControl() pretty >> much confusing. Consequently, it wouldn't make sense to deprecate using > > SplFileObject is a bit of a problem since it has single setting for both > reading and writing. I'd say it's fine to deprecate using escape there, > with the idea that if somebody needs it for reading, they'd ignore the > deprecation message, or use fgetcsv. I guess using single set of setting > for both read and write is not that great an idea, in retrospect, but we > probably can't do too much about it. > > I think allowing not having an escape and making it the default is a > good idea, though mismatch between read and write may be problematic. At > least the first part - allowing not having escape - I think should be > done and does not need RFC even, but the default change probably does > and I think this should be in a major version, since it's a BC break, > albeit not a major one. So, I'd do this: > > 1. Enable no escape char at all ASAP > 2. Switch to no escape by default for read & write for PHP 8 > 3. Deprecate non-empty escape for SplFileObject and fputcsv for PHP 8, > leave fgetcsv alone. I don't think we're doing anyone a favor by introducing even more inconsistencies between reading and writing CSV. Also, if we stick with the legacy CSV reading, we can't simplify the overly complex implementation. Therefore, I suggest to only add support for an empty $escape parameter (PR #3515), and withdraw the RFC to deprecate and eventually remove the proprietary escaping mechanism. -- Christoph M. Becker