UnofficialCrusaderPatch / UnofficialCrusaderPatch3

Development for the dll Injection approach
GNU General Public License v3.0
11 stars 2 forks source link

aicloader does not handle UTF-8 BOM value #49

Closed gynt closed 1 year ago

TheRedDaemon commented 1 year ago

Is this a shortcoming of the used parser?
After all, I think all files I can remember are JSON or YAML.

gynt commented 1 year ago

Yes I think so, but it could maybe be solved with addressing the bit of code in the aicloader to look for the BOM. It doesn't need the utf-8 BOM, it can read utf-8 AFAIK

TheRedDaemon commented 1 year ago

That seems weird. Maybe look in their documentation again (maybe they documented this). I mean, we could strip the BOM bytes if we find them, but that should not be something we have to care about.

gynt commented 1 year ago

Yea, maybe we need a proper json loader (or a yaml loader actually, because yaml can read json), so I can get rid of the lua implemented ones! I looked into lyaml but it needs compilation and libyaml, and I don't know how to compile libyaml on windows, should be possible though. I need to learn cmake, or integrate that into the build process...

This is quite high priority though, because it can solve other lame stupid bugs we encounter that are simply due to slightly non-standard formatted files.

TheRedDaemon commented 1 year ago

quite high priority

Adds "medium-priority" 🙃

Otherwise approved. Maybe you can check Nuget for a Yaml parser. Would have the advantage of being simple to add as dependency.

gynt commented 1 year ago

Solved with: 0ffc70dbc0904671a5d309192df00eceea713486