Allow non-ASCII characters in shortcut AppName.#7
Allow non-ASCII characters in shortcut AppName.#7Ryochan7 wants to merge 1 commit intoscottrice:masterfrom
Conversation
This was mainly to work around problems with a custom shortcut for Star Wars: Dark Forces from GOG. The name has a Registerted Sign (U+00AE) in it which would make the name fail to convert to ascii and cause the script to stop.
|
Sweet, thanks for doing this! Could you explain more about why you changed the lines you did? I'm not super familiar with character encodings, but I see changes to the shortcut generator but not the shortcut parser. It may just be early in the morning, but what was causing the error before and why do these lines fix it? |
|
python reads the shortcuts.vdf file fine and the name is encoded as a byte string. The problem was occurring while attempting to convert that byte string to unicode in ShortcutGenerator.generate_keyvalue_pair and also for the conversion when writing the new shortcuts.vdf file in shortcuts.write_shortcuts. Here is the output of the main error: |
|
@Ryochan7 @scottrice , this is very similar to in an old commit for Ice (b1b1f08), when the structure of Ice was a bit different. |
This change was mainly to work around problems with a custom shortcut for Star Wars: Dark Forces purchased from GOG. The name has a Registerted Sign (U+00AE) in it which would make the name fail to convert to ascii and cause the script to stop. The change seems to work fine for my other non-Steam app shortcuts as well.