PhpSpreadsheet/docs/topics
oleibman ce6ac1f040
Fix For #1509 (#1518)
* Fix For #1509

User expected no CSV enclosures after $writer->setEnclosure(''),
which had been changed to be consistent with $reader->setEnclosure('').
Writer will now omit enclosures after code above; no change to Reader.
Tests have been added for this condition.

* Add Option to Write CSV Enclosure Only When Required

Allowing the user to specify no enclosure when writing a CSV can lead to
a situation where PhpSpreadsheet (likewise Excel) will not read the
resulting file as intended, e.g. if any cell contains a delimiter character.
This is demonstrated in new test TestBadReread.
No existing setting will rectify this situation.

A better choice would be to add an option to write the enclosure
only when it is needed, which is what Excel does. The RFC4180 spec at
https://tools.ietf.org/html/rfc4180
states when it is needed - when the cell contains the delimiter,
or the enclosure, or a newline.
New test TestGoodReread demonstrates that the file is read as intended.

The documentation has been updated to describe the new function,
and to change the write example where the enclosure is set to null.

* Scrutinizer Suggestions

3 minor changes, all in tests.
2020-06-19 20:28:57 +02:00
..
images Update documentation with composer instructions 2017-03-13 12:30:26 +09:00
accessing-cells.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
architecture.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
autofilters.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
calculation-engine.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
creating-spreadsheet.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
file-formats.md Prefer https:// URLs when available in docs & comments 2018-10-28 13:55:00 +11:00
memory_saving.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
migration-from-PHPExcel.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
reading-and-writing-to-file.md Fix For #1509 (#1518) 2020-06-19 20:28:57 +02:00
reading-files.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
recipes.md Typo 2020-06-03 09:13:52 +09:00
settings.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00
worksheets.md Code highlight in docs for PhpStorm 2020-05-31 22:44:25 +09:00