Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112248 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 22063 invoked from network); 15 Nov 2020 02:38:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Nov 2020 02:38:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0F79A1804C6 for ; Sat, 14 Nov 2020 18:01:48 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_KAM_HTML_FONT_INVALID autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 14 Nov 2020 18:01:46 -0800 (PST) Received: by mail-oi1-f182.google.com with SMTP id d9so14924894oib.3 for ; Sat, 14 Nov 2020 18:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chall-id-au.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=Rw8ZRwG4d091UsyzK2oM8l5HROO5IpUh2jMrxbdwPf8=; b=JQtxgXPlP96pMgbr7Ee78t3RB7ikIkGGue+Qu32rSagSp6idTBEkxZvPIFt64Z5fJ8 FFNV+j3k2CYnwNNyEhFs0sVFl3OYPkD9vNF1UwWt8gkReqrn9710SqfdM514ctn2x+DQ FV0kWltfZpC6NcCwCv5sSQAJjzYmp/HXeWJF1C01VFha9AgAWhMbgRxwrCiSxyv68/8B s6CxOq6SWt3gxF2oE1tzSEJq5qvnAwKmMJMyDf2jdHbJHz5+ja9wL/dGBpfQ2QkZflWA VPFokEVLH7qBmLN4ZRjor75yzAX99jl2Oz6ZVtIo1VG7N5CrtXkzFB8PTXmW+MAf1jC/ /69A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Rw8ZRwG4d091UsyzK2oM8l5HROO5IpUh2jMrxbdwPf8=; b=Qfxeiw3BYcQt3fZZlq/7IXHYw8tIGFfBCaJ13em2flrBhX9POrqW+6j1FZjzJ50tlS QdkPiXmii5Z2mwgXi2ByjldIidn7MQUYK/22SvW3hrjPtF6tJHA7oXLMzuDhhOoGk+OC hsUUdTMNfL12NCr1Kn9Oo97pwRuNI3Jr/nUcn7tuUX5ONhyHols8mwyA4LPI2hnVz/du jLSnnphcYxA/NYg02YkXqZ4Ssvc3evC3ajcrpGSDIXHrrhwI14+PxG+vmDAxih3n/k9U 53RjpNHJPgeLk/6AUOCUaSDwFJDnPeLBhOxVyvCo2OjJE/kLXPaf67zm8EX7x7rxBsfh DGYQ== X-Gm-Message-State: AOAM533iuofOlK4MJDxlNV6H58ny20PbDaqZUi0mvcbGtvNOydqmjFIa z9YaStyEIxFA2qL4HLgCp9Zfbtfq1+aQdBgZ4gqZ8qjWjVFtBw== X-Google-Smtp-Source: ABdhPJwDKp7HEwsGSFxvP4CNnKvEtUpVmDppsWOep++blEOanwjIe/rdVJu367UajMUWI/rpTHxspepVTIC3KpNFDZY= X-Received: by 2002:aca:c60c:: with SMTP id w12mr6451536oif.174.1605405705619; Sat, 14 Nov 2020 18:01:45 -0800 (PST) MIME-Version: 1.0 Date: Sun, 15 Nov 2020 13:01:34 +1100 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000cde10a05b41ba457" Subject: fputcsv is not compliant with the CSV RFC From: me@chall.id.au (Cameron Hall) --000000000000cde10a05b41ba457 Content-Type: text/plain; charset="UTF-8" Hi internals, I've come across a small nuance recently noticing that the fputcsv function isn't compliant with the RFC because it uses LF as a line terminator instead of CRLF as per RFC 4810[1]. There are a few related bug reports already; #42357[4], #46367[2] and #62770[3]. I've created a pull request[5] to address the issue by adding a new parameter that allows a user defined line ending as suggested in bug report #42357[4]. In order to maintain backwards compatibility, fputcsv() still terminates lines with "\n" by default. While my pull request is addressing a bug, adding a new parameter is also a new feature. I'd love to see some opinions from the internals team regarding the best way forward. Kind regards, Cameron [1] https://tools.ietf.org/html/rfc4180 [2] https://bugs.php.net/bug.php?id=46367 [3] https://bugs.php.net/bug.php?id=62770 [4] https://bugs.php.net/bug.php?id=42357 [5] https://github.com/php/php-src/pull/6403 --000000000000cde10a05b41ba457--