Also set locale for boost::filesystem::path

This commit is contained in:
Yukino Song
2024-10-29 01:53:15 +08:00
parent 551999be48
commit 47cd872714

View File

@@ -95,7 +95,9 @@ main(int argc, char *argv[]) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// Use UTF-8 conversion for the default C++ locale (used by boost::log)
std::locale::global(std::locale(std::locale(), new std::codecvt_utf8<wchar_t>));
std::locale utf8_locale(std::locale(), new std::codecvt_utf8<wchar_t>);
std::locale::global(utf8_locale);
boost::filesystem::path::imbue(utf8_locale);
#pragma GCC diagnostic pop
mail::man = std::make_shared<safe::mail_raw_t>();