Merge pull request #8542 from Itrimel/fix-gecko-loading

Fix Gecko codes loading
This commit is contained in:
JosJuice
2020-02-15 16:28:32 +01:00
committed by GitHub

View File

@ -85,6 +85,11 @@ std::vector<GeckoCode> DownloadCodes(std::string gametdb_id, bool* succeeded)
{ {
std::istringstream ssline(line); std::istringstream ssline(line);
std::string addr, data; std::string addr, data;
// Some locales (e.g. fr_FR.UTF-8) don't split the string stream on space
// Use the C locale to workaround this behavior
ssline.imbue(std::locale::classic());
ssline >> addr >> data; ssline >> addr >> data;
ssline.seekg(0); ssline.seekg(0);
@ -139,6 +144,10 @@ std::vector<GeckoCode> LoadCodes(const IniFile& globalIni, const IniFile& localI
{ {
std::istringstream ss(line); std::istringstream ss(line);
// Some locales (e.g. fr_FR.UTF-8) don't split the string stream on space
// Use the C locale to workaround this behavior
ss.imbue(std::locale::classic());
switch ((line)[0]) switch ((line)[0])
{ {
// enabled or disabled code // enabled or disabled code