Fix #500: Genius, Musixmatch and LRCLIB receive malformed response - #508
Fix #500: Genius, Musixmatch and LRCLIB receive malformed response#508victorwon2001 wants to merge 2 commits into
Conversation
|
You mention it fixes lrclib, genius and muximatch but have not changed the code for musixmatch or genius and have not explained how your change fixes those. You've also haven't provided tests to cover the case you're attempting to fix. |
|
Genius, Musixmatch, and LRCLIB do not need separate locale fixes because build/foo_openlyrics.vcxproj compiles the shared 3rdparty/cJSON/cJSON.c implementation with ENABLE_LOCALES, and all three sources use that same implementation through cJSON_Parse or cJSON_ParseWithLength. The regression test cjson_parses_source_responses_with_comma_decimal_locale in src/sources/lrclib.cpp directly covers representative responses for all three sources under a comma-decimal locale and restores LC_NUMERIC afterward. The x86/x64 Build & test checks on GitHub head 1fb54f2 were successful; this later follow-up has not yet received those GitHub runs. Separately, the independent local comma-locale cJSON harness passed. |
|
I see, although I find your commit messages pretty non-descriptive. So I gather your problem is that the parsing functions used by cJSON are locale-aware by default and you want it to not be locale-aware so that it will always correctly parse Also, a quick search is not finding me any documentation on |
|
Almost, but the direction is the opposite: Upstream references:
That is also why Genius and Musixmatch do not need separate changes: this project compiles one shared |
Fixes #500
Implementation summary
Enabled locale-aware cJSON parsing and added regression coverage for Genius, Musixmatch, and LRCLIB-shaped responses under a comma-decimal locale.
Changes
Testing