SteamGridDB / SGDBoop

A program used for applying custom artwork to Steam, using SteamGridDB. Supports both Windows and Linux, written completely in C.

Home Page:https://www.steamgriddb.com/boop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

DragRedSim opened this issue · comments

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:

struct nonSteamApp* selectNonSteamApp(char* sgdbName, struct nonSteamApp* apps) {

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.