LeagueOfPoro / EsportsCapsuleFarmer

Automatically watch all live matches on lolesports and farm Esports Capsules
https://www.youtube.com/c/LeagueOfPoro
Other
95 stars 23 forks source link

UTF-8 encoding of the config file is not supported #28

Closed Smeja64 closed 1 year ago

Smeja64 commented 1 year ago

When I change the config file to UTF-8 (I have some non-ANSI-encodable characters in my account's name), the program crashes with the following traceback:

Traceback (most recent call last):
  File "main.py", line 147, in <module>
  File "main.py", line 63, in readConfig
  File "yaml\__init__.py", line 125, in safe_load
  File "yaml\__init__.py", line 79, in load
  File "yaml\loader.py", line 34, in __init__
  File "yaml\reader.py", line 85, in __init__
  File "yaml\reader.py", line 124, in determine_encoding
  File "yaml\reader.py", line 178, in update_raw
  File "encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 223: character maps to <undefined>
[4004] Failed to execute script 'main' due to unhandled exception!

When I remove the problematic character and keep it in UTF-8, it just says Invalid configuration file. IGNORING... and wants me to log in manually.

LeagueOfPoro commented 1 year ago

The provided config is already in UTF-8. Anyway, the config is now read explicitly as UTF-8. See if that helps

Smeja64 commented 1 year ago

That's weird. Maybe it's Notepad's fault, but when I tried to edit the file it told me, that some characters can't be encoded using ANSI and promted me to select a different encoding. Will try the patch and post an update

Smeja64 commented 1 year ago

I tried the patch and edited the config with Notepad++ this time and it showed the config was UTF-8 encoded, so idk what was wrong before, probably some Notepad shenanigans. Anyways it works now, thx <3