Bug #78457 [Opn->Ver]: str_getcsv parses the CSV error
| From: | cmb@php.net | 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