From 47cd872714bdcbf59752aeda0099958f42934d61 Mon Sep 17 00:00:00 2001 From: Yukino Song Date: Tue, 29 Oct 2024 01:53:15 +0800 Subject: [PATCH] Also set locale for boost::filesystem::path --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 9a29c913..82d60e4f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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)); + std::locale utf8_locale(std::locale(), new std::codecvt_utf8); + std::locale::global(utf8_locale); + boost::filesystem::path::imbue(utf8_locale); #pragma GCC diagnostic pop mail::man = std::make_shared();