PhpSpreadsheet/tests/data/Reader/CSV
oleibman 2f1f3a19b8
Csv, Boolean, and StringValueBinder (#2374)
See the discussion in PR #2232 which came about 3 months after it was merged. It caused a problem in an unusual situation which did not come to light until the change was part of the new release version. The original PR changed PhpSpreadsheet's behavior to match Excel's for (not case sensitive) strings `TRUE` and `FALSE`. Excel treats the values as boolean, and now so does PhpSpreadsheet.

When StringValueBinder is used, this becomes a tricky situation. The user wants the original strings preserved, including the case of all the letters. This PR changes the behavior of CSV reader as follows:
- If StringValueBinder is not in effect, convert to boolean.
- If StringValueBinder (actually any binder with method getBooleanConversion) is in effect, and the result of getBooleanConversion is true (which is the default in StringValueBinder), leave the value coming out of Csv Reader as the unchanged string.
- Otherwise, convert to boolean.

This should mean that there are no regression problems with StringValueBinder, while allowing PhpSpreadsheet to continue to match Excel in the default situation. No new settings are required.
2021-11-12 00:04:08 -08:00
..
backslash.csv Allow CSV escape character to be set 2018-05-23 10:31:41 +09:00
contains_html.csv Could not open CSV file containing HTML fragment 2018-06-25 11:12:27 +09:00
csv_without_extension Could not open CSV file containing HTML fragment 2018-06-25 11:12:27 +09:00
empty.csv Check for MIME type to know if CSV reader can read a file 2018-02-05 21:33:23 +09:00
enclosure.csv Better auto-detection of CSV separators 2017-12-28 12:25:37 +09:00
encoding.iso88591.csv Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
encoding.utf8.csv Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
encoding.utf8bom.csv Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
encoding.utf16be.csv Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
encoding.utf16le.csv Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
encoding.utf32be.csv Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
encoding.utf32le.csv Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
escape.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
issue.2232.csv Csv, Boolean, and StringValueBinder (#2374) 2021-11-12 00:04:08 -08:00
line_break_escaped_32le.csv CSV Sample File Was Miscoded (#1489) 2020-05-24 19:57:39 +09:00
line_break_in_enclosure.csv Fix CSV delimiter detection on line breaks 2018-10-21 18:23:55 +11:00
line_break_in_enclosure_with_escaped_quotes.csv CSV Sample File Was Miscoded (#1489) 2020-05-24 19:57:39 +09:00
no_delimiter.csv Csv reader avoid notice when the file is empty 2018-10-28 14:16:53 +11:00
premiere.utf8.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.utf8bom.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.utf16be.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.utf16bebom.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.utf16le.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.utf16lebom.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.utf32be.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.utf32bebom.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.utf32le.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.utf32lebom.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
premiere.win1252.csv CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
semicolon_separated.csv Infer CSV delimiter if it hasn't been set explicitly 2017-04-20 17:02:03 +09:00
sep.csv Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00
utf16be.line_break_in_enclosure.csv Improve Coverage for CSV (#1475) 2020-05-17 18:15:18 +09:00