Bug #78457 [Opn->Ver]: str_getcsv parses the CSV error

From: Date: Mon, 26 Aug 2019 07:01:26 +0000
Subject: Bug #78457 [Opn->Ver]: str_getcsv parses the CSV error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222413@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78457&edit=1 ID: 78457 Updated by: cmb@php.net Reported by: baoguoxiao0538 at hotmail dot com Summary: str_getcsv parses the CSV error -Status: Open +Status: Verified Type: Bug Package: Strings related Operating System: windows PHP Version: 7.3.8 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: I can confirm this erroneous behavior for the zh-cn locale; it works as expected for the en-us locale, though. So as a work-around for now, you may consider: var_dump(setlocale(LC_ALL, 'en-us')); var_export(str_getcsv('应收账款上账日期,客户名称,凭证号,摘 要,借方本币,贷方本币,账龄区间,出库日期,回款上账日期,回款天数')); Previous Comments: ------------------------------------------------------------------------ [2019-08-26 02:25:53] baoguoxiao0538 at hotmail dot com Description: ------------ The PHP execution code in the Linux environment is normal, but the execution result in Windows is wrong Test script: --------------- var_export(str_getcsv('应收账款上账日期,客户名称,凭证号,摘 要,借方本币,贷方本币,账龄区间,出库日期,回款上账日期,回款天数')); Expected result: ---------------- array ( 0 => '应收账款上账日期', 1 => '客户名称', 2 => '凭证号', 3 => '摘 要', 4 => '借方本币', 5 => '贷方本币', 6 => '账龄区间', 7 => '出库日期', 8 => '回款上账日期', 9 => '回款天数', ) Actual result: -------------- array ( 0 => '应收账款上账日期', 1 => '客户名称', 2 => '凭证号,摘 要,借方本币', 3 => '贷方本币', 4 => '账龄区间', 5 => '出库日期', 6 => '回款上账日期', 7 => '回款天数', ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78457&edit=1

« previous php.bugs (#222413) next »