BartoszCichecki / LenovoLegionToolkit

Lightweight Lenovo Vantage and Hotkeys replacement for Lenovo Legion laptops.
GNU General Public License v3.0
4.57k stars 220 forks source link

[BUG]: LLT Crashes when trying to open Application Folders (Path contains chinese characters) #731

Closed Ace-Radom closed 1 year ago

Ace-Radom commented 1 year ago

Version

2.13.0

OS

Windows 11 22H2 Build 22621

Device

Legion R9000p 2021H

BIOS version

GKCN50WW

What's wrong?

Today I tried to open application folders (Data and Temp Folder), LLT Crashed with error message:

image

How to reproduce the bug?

  1. Go to About
  2. Click on either Data or Temp folder under Application Folders
  3. Error occurs, LLT crashes

What is the behavior that you expected?

It's most likely to be a problem with non-ASCII-char-only pathes. I asked my friend to test this behavior on his laptop (new R9000p 2023) and the expected error didn't occur. He opened the folders successfully. The difference is: his user name contains ONLY ASCII chars, but mine contains chinese characters. You can also see in the error message that the user name is encoded, but maybe not correctly. (Sadly, there are always problems with chinese chars in windows)

Logs

log_2023_05_22_07_32_01.txt

Do you have Lenovo software installed?

Did you disable any Lenovo software using Lenovo Legion Toolkit?

Additional information

Additionally, I'm using windows 11 chinese edition, and code page 936.

image

It means: active code page: 936. I wrote one or two programs and they had the same problems, and at last it turned out to be something with code page (and system encode type). I don't know how does C# encode chars and also I have no idea if it would help, but I think that I should let you know.

BartoszCichecki commented 1 year ago

@Ace-Radom can you try this build?

LenovoLegionToolkitSetup.zip

Ace-Radom commented 1 year ago

I've just tested it and everything seem to be alright, it opened the right folder successfully. Thx for the fix xD