Core/Locales: Revert back to using C locale for number formatting

This commit is contained in:
Shauren
2023-11-25 13:57:25 +01:00
parent 5e8f023623
commit 1c6ee8a6bd

View File

@@ -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()