Skip to content

Commit 767219c

Browse files
committed
The default value of the escape option is now an empty string
1 parent 3708bad commit 767219c

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

UPGRADE-2.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# UPGRADE FROM 1.x to 2.0
22

33
* Remove deprecated `unix2dos_path` option
4+
* The default value of the `escape` option is now an empty string (previously `\`), to ensure compliance with RFC 4180

src/Csv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct(string $pathDir, string $filename, array $options =
6262
'delimiter' => ',',
6363
'enclosure' => '"',
6464
'eol' => self::EOL_LF,
65-
'escape' => '\\',
65+
'escape' => '',
6666
'add_utf8_bom' => false,
6767
]);
6868
$resolver->setAllowedTypes('header', ['null', 'array']);

tests/CsvTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testWithDefaultOption(): void
5656
$this->assertCsvFile('my-csv.csv', [
5757
'"a a",bb',
5858
'cc,dd',
59-
'"c""c","d\"d"',
59+
'"c""c","d\""d"',
6060
]);
6161
}
6262

0 commit comments

Comments
 (0)