diff --git a/src/main.c b/src/main.c index da6dcbed..30340356 100644 --- a/src/main.c +++ b/src/main.c @@ -19,6 +19,7 @@ #define _GNU_SOURCE // for basename() #include +#include #include #include #include @@ -157,6 +158,12 @@ int main(int argc, char **argv) int index; int ret; + /* Set locale to system locale + * Change from the standard (C) to system locale, so libarchive can + * handle filename conversions. + * More information on the libarchive problem: + * https://github.com/libarchive/libarchive/wiki/Filenames */ + setlocale(LC_ALL, ""); if (parse_options(argc, argv, &index) < 0) { return EINVALID_OPTION; }