From 2cd1a9ee265c6ecfbe882ab5432b1efd6f8a93a0 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Wed, 24 Jul 2024 19:21:35 -0300 Subject: [PATCH] use C locale instead of en_us.utf8 TODO: replace these with numFromString instead :P --- loader/src/loader/ModMetadataImpl.cpp | 2 +- loader/src/ui/mods/settings/GeodeSettingNode.cpp | 2 +- loader/src/ui/nodes/ColorPickPopup.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/loader/src/loader/ModMetadataImpl.cpp b/loader/src/loader/ModMetadataImpl.cpp index c689bc26..f9f7cbc8 100644 --- a/loader/src/loader/ModMetadataImpl.cpp +++ b/loader/src/loader/ModMetadataImpl.cpp @@ -151,7 +151,7 @@ Result ModMetadata::Impl::createFromSchemaV010(ModJson const& rawJs if (ver != "*") { double val = 0.0; errno = 0; - if (std::setlocale(LC_NUMERIC, "en_US.utf8")) { + if (std::setlocale(LC_NUMERIC, "C")) { val = std::strtod(ver.c_str(), nullptr); if (errno == ERANGE) { return Err("[mod.json] has invalid target GD version"); diff --git a/loader/src/ui/mods/settings/GeodeSettingNode.cpp b/loader/src/ui/mods/settings/GeodeSettingNode.cpp index 90ad665e..e07dbfd1 100644 --- a/loader/src/ui/mods/settings/GeodeSettingNode.cpp +++ b/loader/src/ui/mods/settings/GeodeSettingNode.cpp @@ -27,7 +27,7 @@ Num parseNumForInput(std::string const& str) { else if constexpr (std::is_same_v) { double val = 0.0; errno = 0; - if (std::setlocale(LC_NUMERIC, "en_US.utf8")) { + if (std::setlocale(LC_NUMERIC, "C")) { val = std::strtod(str.c_str(), nullptr); if (errno == 0) { return val; diff --git a/loader/src/ui/nodes/ColorPickPopup.cpp b/loader/src/ui/nodes/ColorPickPopup.cpp index 49f5d1bf..da8cde82 100644 --- a/loader/src/ui/nodes/ColorPickPopup.cpp +++ b/loader/src/ui/nodes/ColorPickPopup.cpp @@ -22,7 +22,7 @@ static GLubyte parseInt(char const* str) { static GLubyte parseFloat(char const* str) { float val = 0.0f; errno = 0; - if (std::setlocale(LC_NUMERIC, "en_US.utf8")) { + if (std::setlocale(LC_NUMERIC, "C")) { val = std::strtof(str, nullptr); if (errno == 0) { return val;