From 14d0e70ae66e0fae60b7fb7a851f58757a43c56a Mon Sep 17 00:00:00 2001 From: emeric Date: Sun, 25 Jun 2023 20:56:33 +0200 Subject: [PATCH] Set local from system. Needed by libarchive to properly handle file entries --- src/lms/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lms/main.cpp b/src/lms/main.cpp index 185fc208..4cb86c98 100644 --- a/src/lms/main.cpp +++ b/src/lms/main.cpp @@ -207,6 +207,12 @@ int main(int argc, char* argv[]) Service config {createConfig(configFilePath)}; Service logger {std::make_unique()}; + // use system locale. libarchive relies on this to write filenames + if (char *locale {::setlocale(LC_ALL, "")}) + LMS_LOG(MAIN, INFO) << "locale set to '" << locale << "'"; + else + LMS_LOG(MAIN, WARNING) << "Cannot set locale from system"; + // Make sure the working directory exists std::filesystem::create_directories(config->getPath("working-dir")); std::filesystem::create_directories(config->getPath("working-dir") / "cache");