From af1877b7f64f5fb7895980e711eb1b9595ef0e23 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Mon, 26 Jun 2023 18:40:38 +0200 Subject: [PATCH] Call setlocale(LC_ALL) to make sure libarchive works correctly --- src/dwarfs/error.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dwarfs/error.cpp b/src/dwarfs/error.cpp index d4f76f4f..c4250a02 100644 --- a/src/dwarfs/error.cpp +++ b/src/dwarfs/error.cpp @@ -20,6 +20,7 @@ */ #include +#include #include #include @@ -82,6 +83,9 @@ int safe_main(std::function fn) { #ifndef _WIN32 folly::symbolizer::installFatalSignalHandler(); #endif + auto loc = std::getenv("LC_ALL"); + std::setlocale(LC_ALL, loc ? loc : ""); + return fn(); } catch (system_error const& e) { std::cerr << "ERROR: " << folly::exceptionStr(e) << " [" << e.file() << ":"