SteamGridDB / SGDBoop

A program used for applying custom artwork to Steam, using SteamGridDB. Supports both Windows and Linux, written completely in C.
https://www.steamgriddb.com/boop
zlib License
253 stars 10 forks source link

Boop application misinterprets UTF-8 text as the native codepage of the operating system #40

Open DragRedSim opened 1 year ago

DragRedSim commented 1 year ago

As per the title.

Example: attempting to boop from the game https://www.steamgriddb.com/game/5262323 gives the following: image Note the character in the title which maps to hex C2, which in Windows-1252 produces a Latin Capital letter A with circumflex , but which in UTF-8 is a pointer to Latin-1 Supplement, with the following character, hex AE, being shown in its Windows-1252 representation as the correct character, the registered trademark symbol. The string displays correctly on the SteamGridDB site, since pages there declare the UTF-8 encoding

Function reference: https://github.com/SteamGridDB/SGDBoop/blob/3fb75d2ad698181c2d678bbcd9f8a66208106356/sgdboop.c#L892 Since the string is passed in as a char* pointer, it will be treated as a set of bytes without care given to the encoding within.

As a workaround, if the user enables UTF-8 support in Windows 11, it should parse the characters correctly.

I suspect this will also extend to the qsort() call within the function, causing certain cases not to match where they may otherwise appear to do so.