Mino260806 / miwtool

A tool for manipulating Redmi Watch 2 Lite watchface files
GNU General Public License v3.0
36 stars 8 forks source link

Fixed “Unexpected UTF-8 BOM” error when using encode_wfeditor #21

Open Timofei302 opened 5 months ago

Timofei302 commented 5 months ago

When trying to compile a watchface file for Redmi Watch 2 lite created in WatchfaceEditor, the script crashed with the error JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig).

The error was solved by adding .encode().decode('utf-8-sig') to the line https://github.com/Mino260806/miwtool/blob/557bf03bbd6427b62b42132b7cc031aa52ad95bb/wfeditor/parser.py#L31 error_screenshot