Call setlocale(LC_ALL) to make sure libarchive works correctly

This commit is contained in:
Marcus Holland-Moritz 2023-06-26 18:40:38 +02:00
parent f671976526
commit af1877b7f6

View File

@ -20,6 +20,7 @@
*/
#include <cerrno>
#include <clocale>
#include <cstdlib>
#include <iostream>
@ -82,6 +83,9 @@ int safe_main(std::function<int(void)> 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() << ":"