Skip to content

Commit 8ec0bf6

Browse files
committed
dtar: set the locale for character handling
This ensures that UTF-8 file names are handled correctly by libarchive.
1 parent 03b1122 commit 8ec0bf6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/dtar/dtar.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ static void print_usage(void)
161161

162162
int main(int argc, char** argv)
163163
{
164+
/* Set the locale for character handling to the user's environment settings
165+
* to ensure that file names are handled correctly by libarchive */
166+
setlocale(LC_CTYPE, "");
167+
164168
MPI_Init(&argc, &argv);
165169
mfu_init();
166170

0 commit comments

Comments
 (0)