[Bug] HeroicBashLauncher doesn't work in steam deck game mode if the prefix has non-ascii characters in it.
Closed this issue · 5 comments
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
- Install Darkest Dungeon from heroic, which has a prefix with the symbol ® in it ("\xae")
- Enable cloud sync
- Try to run it using HeroicBashLauncher in game mode, it fails.
Expected behavior
The game should run. Anyway it looks like
Screenshots
Relevant traceback:
Traceback (most recent call last):
File "HeroicBashLauncher.py", line 43, in <module>
File "launchgame.py", line 21, in launch
UnicodeEncodeError: 'ascii' codec can't encode character '\xae' in position 200: ordinal not in range(128)
[3] Failed to execute script 'HeroicBashLauncher' due to unhandled exception!
Using Bash Launcher 2.5.0
Details
- Platform: Steam Deck
- OS: [e.g. Ubuntu]
- Heroic Version: Shouldn't matter
- Bash Launcher Version: 2.5.0 Flatpak
Additional context
Might not be a terrible idea to enable: https://docs.python.org/3/library/os.html#python-utf-8-mode
To easily reproduce, just run the game script script with LC_ALL=C. It appears that the locale isn't set when in game mode, causing it to assume ascii strings.
Workaround was to add export LC_ALL=en_US.UTF-8 in the generated game scripts before running the flatpaks.
I'll implement it soon and learn more about this. For now, just remove the symbol in the name.
Sure, as I mentioned, I worked around it by setting that environment variable in the script rather than recreating the prefix.
Yeah, I think this should be it. I'll probably just add that command when creating the launch scripts. This way, the user doesn't need to perform an extra step i.e. delete symbols from folder names manually.
So I've got the program to add the environment variable (use UTF-8 encoding) when creating the launch scripts. Hopefully, it'll solve any issues related to non-ascii characters.