mik icon indicating copy to clipboard operation
mik copied to clipboard

BOM in mappings files causes field mismatches

Open mjordan opened this issue 8 years ago • 3 comments

If a mappings file is encoded with a BOM (Byte Order Mark), MIK fails to map the first field in the mappings file. Possible solutions:

  1. Humans should not save the mappings files with BOMs.
  2. MIK, if possible, should remove the BOM for the humans. This should be safe to do if the mappings file is encoded in UTF-8, where the BOM is optional and not recommended.

Thank you @MarcusBarnes for troubleshooting this.

mjordan avatar Apr 04 '16 22:04 mjordan

Turns out that the CSV library we're using offers an easy way to strip out the BOM.

mjordan avatar Apr 07 '16 03:04 mjordan

Just encountered another user whose data contained a bunch o'BOMs. If there is no good reason to not implement the CSV parser's option to remove BOMs, we should do it.

mjordan avatar May 24 '17 19:05 mjordan

Adding $reader->stripBOM(TRUE); within the CsvToMods parser's getMappingsArray() isn't working. Going to continue trying.

mjordan avatar May 24 '17 21:05 mjordan