PhpSpreadsheet/tests/data/Reader
oleibman e768cb0f19
CSV - Guess Encoding, Handle Null-string Escape (#1717)
* CSV - Guess Encoding, Handle Null-string Escape

This is in response to issue #1647 (detect CSV character encoding).
First, my tests with mb_detect_encoding indicate that it doesn't work
well enough; regardless, users can always do that on their own
if they deem it useful.
Rolling my own is also troublesome, but I can at least:
a. Check for BOM (UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE).
b. Do some heuristic tests for each of the above encodings.
c. Fallback to a user-specified encoding (default CP1252)
  if a and b don't yield result.
I think this is probably useful enough to include, and relatively
easy to expand if other potential encodings should be considered.

Starting with PHP7.4, fgetcsv allows specification of null string as
escape character in fgetcsv. This is a much better choice than the PHP
(and PhpSpreadsheet) default of backslash in that it handles the file
in the same manner as Excel does. There is one statement in Reader/CSV
which would be adversely affected if the caller so specified (building
a regular expression under the assumption that escape character is
a single character). Fix that statement appropriately and add tests.
2020-12-25 17:47:29 +01:00
..
CSV CSV - Guess Encoding, Handle Null-string Escape (#1717) 2020-12-25 17:47:29 +01:00
Gnumeric Forgot to check in the test files for the unit tests 2020-07-05 16:28:46 +02:00
HTML Improve Coverage for HTML Reader 2020-06-25 22:42:38 -07:00
Ods Improve Coverage for ODS Reader (#1545) 2020-07-26 12:40:49 +09:00
XLS Fix for bug #1592 (UPDATED) (#1623) 2020-12-17 19:41:07 +01:00
XLSX Fix for 3 Issues Involving ReadXlsx and NamedRange (#1742) 2020-12-10 18:08:10 +01:00
Xml Improving Coverage for Excel2003 XML Reader (#1557) 2020-10-11 13:26:56 +02:00