]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
xzdec: Use setlocale() instead of tuklib_gettext_setlocale()
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 19 Dec 2024 16:31:09 +0000 (18:31 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 20 Dec 2024 14:35:13 +0000 (16:35 +0200)
xzdec isn't translated and doesn't need libintl on Windows even
when NLS is enabled, thus libintl_setlocale() cannot interfere
with the locale settings. Thus, standard setlocale() works perfectly.

In the commit 78868b6e, the explanation in the commit message is wrong.

Fixes: 78868b6ed63fa4c89f73e3dfed27abfb8b0d46db
(cherry picked from commit d6796f9ce5359faaaed82926c1735aee3694430f)

src/xzdec/xzdec.c

index 84d319292f32428f745c22ef72cf27132a849500..d916f378ba3041a4fb753b34c1c576fd6fa08f0a 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <stdarg.h>
 #include <errno.h>
+#include <locale.h>
 #include <stdio.h>
 
 #ifndef _MSC_VER
@@ -41,7 +42,6 @@
 #endif
 
 #include "getopt.h"
-#include "tuklib_gettext.h"
 #include "tuklib_progname.h"
 #include "tuklib_exit.h"
 
@@ -425,11 +425,8 @@ main(int argc, char **argv)
        //
        //   - This is needed on Windows to make non-ASCII filenames display
        //     properly when the active code page has been set to UTF-8
-       //     in the application manifest. Use the helper macro from
-       //     tuklib_gettext.h instead of plain setlocale(LC_ALL, "")
-       //     because on Windows the standard call isn't enough for
-       //     full UTF-8 support.
-       tuklib_gettext_setlocale();
+       //     in the application manifest.
+       setlocale(LC_ALL, "");
 
        // Parse the command line options.
        parse_options(argc, argv);