Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100740 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80974 invoked from network); 21 Sep 2017 21:08:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2017 21:08:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.192.177 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.192.177 mail-pf0-f177.google.com Received: from [209.85.192.177] ([209.85.192.177:53254] helo=mail-pf0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/57-62331-C4A24C95 for ; Thu, 21 Sep 2017 17:08:29 -0400 Received: by mail-pf0-f177.google.com with SMTP id x78so3796371pff.10 for ; Thu, 21 Sep 2017 14:08:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=3hx7G5pep/mfY+AfBtBL6B3mYQfag0IQo98d40hnOAM=; b=WIXiZcWg0CgYJdQn1KItWW1hk8UxCfz1K7CN/B3nK6RdO+ZnP4YCGBieEJ0obrJnYz FPTIM6LPLdzOkkxlhcrEdSX8UmBGE6gxjid4IRhklt7XL5KCwYO/lzQjvED4FjUnem13 /88it3joHe8BVy8/rwR97QE539M9w9w803UjHRxkDVpTkxYTYbHqztC8gOTkS5PrUQS7 FL9wJYhMKZffJxbULRC8gD1pRG7xFMzvRvJ3Kg1jcJrDfgsWJ403TYe8d7EuxlLAi6xw xY6maNCQ0bxWWTgZZulQISWQjUffFG++LOn/DwLZZRppKGUFLbzUWW5XO6MIis3gVD18 E6gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3hx7G5pep/mfY+AfBtBL6B3mYQfag0IQo98d40hnOAM=; b=Iw+ygpFgRyZejq/60Skrs2lLv9RZ9vYI002dB9u+CUw1aLdsuky+ygfhGti00HwNL8 XT3cMC/3Ll7ZALqC6V4Sc1RLGvbsViEfUSyy4N/qrYFG3p7QXPBj3rRIk6vLdpvrepEK OLRB5GnOIbZNlf1WJuAcYFRTaEU2Z0Sug+mE5YWgBmn0FWIAPIEfOen7iEVmT9vJw8gW 3vZFPb+qbHH+getmzlkrWIEPkFFljUPkeu/0uwdb4RaC+FDLuKo8DhSTekrqU3PjK0wB LlmfEq62yYuHPYaAwD+tdo+0oqtxHo6vvcUUAz8AVMJHltHNNOWLdv3R9B6K7F4L34DX cWrQ== X-Gm-Message-State: AHPjjUhZavelLbIpPLfKmnd4cgDbuceCpLBapAgPRKr/jmkb0DHY0geV +mkt0mJlmVxeMFZjYu7KCMEak/p0O6KFH6GyNBSAfw== X-Google-Smtp-Source: AOwi7QDYv/oOyo2Yg+wxCoB24shDNj+pk9e9h2hjd+Km5QKY9cqASJM4NSTnOmgO0B955EkFFUVMAsPSPLioCQxTIQw= X-Received: by 10.98.68.215 with SMTP id m84mr7029636pfi.85.1506028105862; Thu, 21 Sep 2017 14:08:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.144.87 with HTTP; Thu, 21 Sep 2017 14:08:25 -0700 (PDT) X-Originating-IP: [77.99.17.151] In-Reply-To: <7cf5adb8-0738-259e-6d1e-f966722fdae2@gmx.de> References: <7cf5adb8-0738-259e-6d1e-f966722fdae2@gmx.de> Date: Thu, 21 Sep 2017 22:08:25 +0100 Message-ID: To: "Christoph M. Becker" Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] fputcsv() and $escape character From: danack@basereality.com (Dan Ackroyd) On 21 September 2017 at 12:43, Christoph M. Becker wrote: > Hi everybody! > > There are several bug reports regarding "broken" fputcsv() behavior in > our tracker, namely, because the $escape parameter causes unexpected > results. For instance: I looked at fixing some of the CSV related bugs about a year or so ago. My conclusions were: i) There is no way to fix the problems that wouldn't cause horrible BC breaks for code that is only coincidentally working currently. ii) Handling strings in C is much more error prone than handling them in PHP. I'm reasonably certain that trying to fix the current functions is the wrong approach, and one of the following would be much better. Either, find a C library that has already been proven to handle CSV parsing/generating 'correctly' and bring that into PHP core under either new function names or namespace. Or, write the code in PHP (or just use https://github.com/thephpleague/csv) and find a way to make that fast enough for people to use. Touching the existing code is pretty certain to bring a lot of pain, without resulting in a fully compliant csv parser/generator. cheers Dan Ack