mik
mik copied to clipboard
BOM in mappings files causes field mismatches
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:
- Humans should not save the mappings files with BOMs.
- 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.
Turns out that the CSV library we're using offers an easy way to strip out the BOM.
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.
Adding $reader->stripBOM(TRUE);
within the CsvToMods parser's getMappingsArray()
isn't working. Going to continue trying.