From c2b26aae9af38ba8c0432ff2fe3bbe4f3d91ac13 Mon Sep 17 00:00:00 2001 From: Stephane Thiell Date: Tue, 13 May 2025 18:24:35 -0700 Subject: [PATCH] dtar: set the locale for character handling This ensures that UTF-8 file names are handled correctly by libarchive. --- src/dtar/dtar.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dtar/dtar.c b/src/dtar/dtar.c index 76809c1c..5f89997d 100644 --- a/src/dtar/dtar.c +++ b/src/dtar/dtar.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "mfu.h" @@ -161,6 +162,10 @@ static void print_usage(void) int main(int argc, char** argv) { + /* Set the locale for character handling to the user's environment settings + * to ensure that file names are handled correctly by libarchive */ + setlocale(LC_CTYPE, ""); + MPI_Init(&argc, &argv); mfu_init();