diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-11-25 13:57:25 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-12-02 15:57:09 +0100 |
commit | e2b26f2038e40760a0f46ae587af9ec985d041eb (patch) | |
tree | 8e121e4155aa3c01250d28e610b9b2181ec1dd4c /src/common/Utilities/Locales.cpp | |
parent | 7be101ac672c904a65e8ac41e04bbddfd19266a7 (diff) |
Core/Locales: Revert back to using C locale for number formatting
(cherry picked from commit 1c6ee8a6bd4330625f6b1b90706ebbcb9536246d)
Diffstat (limited to 'src/common/Utilities/Locales.cpp')
-rw-r--r-- | src/common/Utilities/Locales.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/common/Utilities/Locales.cpp b/src/common/Utilities/Locales.cpp index b4048b9c3f3..b4aa22179cf 100644 --- a/src/common/Utilities/Locales.cpp +++ b/src/common/Utilities/Locales.cpp @@ -20,23 +20,28 @@ namespace { -std::locale _utf8; +std::locale _global; std::locale _calendar; } void Trinity::Locale::Init() { // Change global locale from "C" to UTF-8 for c runtime functions - _utf8 = std::locale(""); - std::locale::global(_utf8); + std::locale utf8(""); + _global = utf8; + _global = std::locale(_global, std::locale::classic(), std::locale::numeric); + std::locale::global(_global); + + std::setlocale(LC_ALL, ""); + std::setlocale(LC_NUMERIC, "C"); boost::locale::generator g; - _calendar = g.generate(_utf8, ""); + _calendar = g.generate(utf8, ""); } std::locale const& Trinity::Locale::GetGlobalLocale() { - return _utf8; + return _global; } std::locale const& Trinity::Locale::GetCalendarLocale() |