Bug #72330 [Fbk->NoF]: str_getcsv() splits fields incorrectly if escape char flollowed by UTF chars
| From: | php-bugs at lists dot php dot net | Date: | Sun, 26 Jun 2016 04:22:27 +0000 |
| Subject: | Bug #72330 [Fbk->NoF]: str_getcsv() splits fields incorrectly if escape char flollowed by UTF chars | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201849@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72330&edit=1
ID: 72330
Updated by: php-bugs@lists.php.net
Reported by: cronfy at gmail dot com
Summary: str_getcsv() splits fields incorrectly if escape char
flollowed by UTF chars
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Strings related
Operating System: Linux Mint 17.1 Rebecca
PHP Version: Irrelevant
Assigned To: cmb
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2016-06-14 13:21:21] cmb@php.net
I can't reproduce this behavior, see <https://3v4l.org/QZJSC>.
Maybe it's locale dependend?
------------------------------------------------------------------------
[2016-06-03 16:00:42] cronfy at gmail dot com
Description:
------------
When escape character set for str_getcsv() is followed by some UTF characters, string is parsed
incorrectly.
I tested it on php 5.4, 5.5, 5.6 and 7.0 - behavior is the same.
Test script:
---------------
$utf_1 = chr(0xD1) . chr(0x81); // U+0440;
$utf_2 = chr(0xD8) . chr(0x80); // U+0600
$string = '"first #' . $utf_1 . $utf_2 . '";"second one"';
$d = str_getcsv($string, ';', '"', "#");
print_r($d);
Expected result:
----------------
Array
(
[0] => first #ÑØ
[1] => second one
)
Actual result:
--------------
Array
(
[0] => first #ÑØ";second one"
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72330&edit=1