JujuAdams / SNAP

Data format converters for GameMaker LTS 2022
MIT License
89 stars 15 forks source link

Added BOM header check for snap_from_csv #14

Closed tabularelf closed 3 years ago

tabularelf commented 3 years ago

Without the BOM header check, this causes issues with CSV files that were made in a spreadsheet software and have BOM at the start. Causing the parser to read the first cell wrong. While it seems like nothing out of the ordinary, as it renders just fine. It adds an invisible character. Breaking any comparison checks. (such as if ("Language" == _csvArray[0][0]))

This fix implements a BOM header check. And if BOM is present, advances the buffer position head by 3 and modifies the size/word_start variables to compensate.

JujuAdams commented 3 years ago

Thank you kindly