fmt: Remove unnecessary locale specifications

As far as I can tell the comments are wrong, in my testing the string representation changes with the locale without using `std::locale{""}`. Moreso, using `std::locale{""}` throws `std::runtime_error` if LC_ALL points to an invalid locale, leading to a crash.
This commit is contained in:
Joshua Vandaële 2026-02-25 06:50:46 +01:00
parent 2a3078b833
commit bcb57a1c5c
No known key found for this signature in database
GPG Key ID: 6BB95AF71EB0F406
3 changed files with 3 additions and 5 deletions

View File

@ -157,8 +157,7 @@ std::string MovieManager::GetRTCDisplay() const
const time_t current_time = CEXIIPL::GetEmulatedTime(m_system, CEXIIPL::UNIX_EPOCH);
const tm gm_time = fmt::gmtime(current_time);
// Use current locale for formatting time, as fmt is locale-agnostic by default.
return fmt::format(std::locale{""}, "Date/Time: {:%c}", gm_time);
return fmt::format("Date/Time: {:%c}", gm_time);
}
// NOTE: GPU Thread

View File

@ -297,8 +297,7 @@ static std::string SystemTimeAsDoubleToString(double time)
if (!local_time)
return "";
// fmt is locale agnostic by default, so explicitly use current locale.
return fmt::format(std::locale{""}, "{:%x %X}", *local_time);
return fmt::format("{:%x %X}", *local_time);
}
static std::string MakeStateFilename(int number)

View File

@ -330,7 +330,7 @@ void PostProcessingConfiguration::SaveOptionsConfiguration()
case ConfigurationOption::OptionType::Float:
{
std::ostringstream value;
value.imbue(std::locale("C"));
value.imbue(std::locale::classic());
for (size_t i = 0; i < it.second.m_float_values.size(); ++i)
{