WhiteMagic / JoystickGremlin

A tool for configuring and managing joystick devices.
http://whitemagic.github.io/JoystickGremlin/
GNU General Public License v3.0
313 stars 45 forks source link

Uncaught exception - illegal multibyte sequence when using the Response Curve plugin #465

Open NoelShourai opened 1 year ago

NoelShourai commented 1 year ago

Edit: Ignore the title, see the message below.

Hi, I'm posting this because while other people have similar issues with uncaught exceptions the other stories I've read don't seem to match mine.

Every time I attempt to remap a joystick axis, button, add or remove a plugin, etc., the program continues to function and I can even activate the existing profile and activate it, but I can no longer make a new profile or load/save the existing profile, I always get the following message:

ERROR Uncaught exception: Traceback (most recent call last): File "joystick_gremlin.py", line 432, in new_profile File "joystick_gremlin.py", line 1018, in _save_changes_request File "joystick_gremlin.py", line 1047, in _has_profile_changed UnicodeDecodeError: 'cp932' codec can't decode byte 0xef in position 0: illegal multibyte sequence

Apparently if I remove all mappings then functionality returns, but if I tried to use the Response Curve plugin then this error message is always in effect. Either way, the only way to truly work around the issue is to delete the profile entirely. I initially thought it was related to the Response Curve plugin itself hence the title, but it looks like the problem is much more severe.

To reproduce:

Version of Joystick Gremlin should be the latest stable version 13.3. I'm using the WinWing F-16EX HOTAS system and MFG Crosswind V2 pedals. I've attached my system.log for reference, just in case. system.log

WhiteMagic commented 1 year ago

I suspect you're running into the same issue as as described in #301, which you should be able to work around by using the setting that makes Windows use UTF8.

NoelShourai commented 1 year ago

I enabled UTF-8 and it seems to resolve the issue at the moment, thanks. However, I'm not quite sure if this is the best solution, since it involves switching the system locale to UTF-8 just for one application.

WhiteMagic commented 1 year ago

Oh no it's not a real solution but only a workaround, as the real solution is to find where file encoding isn't done or getting caught up. Though that won't happen for a while, so until then this is likely the best that can be done.

NoelShourai commented 1 year ago

Hey again, sorry to revive this thread (it's been a long while) but recently I discovered what might be a possible solution that does not involve having to significantly alter your system settings. I just want to jot this down for anyone else who might run into the same issue.

If you have a joystick_gremlin.exe.manifest file (make a backup just in case), underneath <assemblyIdentity ... > add the following:

<application>
     <windowsSettings>
          <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
     </windowsSettings>
</application>

Still needs further testing, but I'm not getting the uncaught exception anymore, even on UTF-16.