assetto-corsa-web / accweb

Assetto Corsa Competizione Server Management Tool via Web Interface.
MIT License
142 stars 54 forks source link

Encoding issues related to bop.json files. #265

Closed kslen closed 8 months ago

kslen commented 8 months ago

Environment:

Description: After encountering difficulties with ACCWeb parsing the bop.json file from LFM, upon analysis, I once more found that ACCWeb consistently outputs bop.json files encoded in "UTF-16LE (with BOM)." However, when attempting to import the LFM bop.json, ACCWeb failed to parse the file, and ACCServer.exe ignored it after manual placement in the correct directories, even after stopping the port and ACCWeb all together.

Observations:

Resolution: The issue was resolved by manually adding the Byte Order Mark (BOM) to the LFM bop.json file using an editor that supports BOM writing, allowing ACCWeb to parse the file correctly.

Enabling BOM in Geany: image

Proposal: Consider implementing a feature in ACCWeb to dynamically check the encoding of presented bop.json files. If the encoding does not match "Unicode text, UTF-16, little-endian text, with no line terminators," automatically convert and standardize the encoding to ensure compatibility.

Benefits:

Implementation: Integrate a mechanism within ACCWeb to identify and convert bop.json files to the specified encoding during import or server startup.

Impact: This feature could significantly streamline bop.json management and contribute to a smoother user experience for ACCWeb administrators.

Considerations: