[0.15.33] Ungraceful handling of UTF8-Byte-order-mark
Posted: Sun Aug 20, 2017 4:14 pm
When encountering a file encoded in UTF-8-with-BOM (Byte Order Mark) factorio currently produces one of several unhelpful errors.I don't know if it's realistic to ask that factorio loads these files normally, so instead i'd be content if it gave a proper error message at least.
(Background context: I frequently deal with files from asian countries, where non Unicode/Latin encodings are common and broken files due to encoding errors far from unheared of, so all my programs are set up to add a BOM by default. I've also seen some other modders be baffled by the errors before.)
Errors currently produced when a file has a BOM:
info.json -> factorio ignores the whole mod completely and starts without it
locale.cfg -> "Missing value at __mod-name__/locale/en/en.cfg:2"
data.lua/control.lua -> "unexpected symbol near char(239)" (seems to always be 239)
(Background context: I frequently deal with files from asian countries, where non Unicode/Latin encodings are common and broken files due to encoding errors far from unheared of, so all my programs are set up to add a BOM by default. I've also seen some other modders be baffled by the errors before.)
Errors currently produced when a file has a BOM:
info.json -> factorio ignores the whole mod completely and starts without it
locale.cfg -> "Missing value at __mod-name__/locale/en/en.cfg:2"
data.lua/control.lua -> "unexpected symbol near char(239)" (seems to always be 239)