Skip to content

Commit

Permalink
xzdec: Use setlocale() instead of tuklib_gettext_setlocale()
Browse files Browse the repository at this point in the history
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 78868b6, the explanation in the commit message is wrong.

Fixes: 78868b6
  • Loading branch information
Larhzu committed Dec 20, 2024
1 parent 34b80e2 commit 4b319e0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/xzdec/xzdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <stdarg.h>
#include <errno.h>
#include <locale.h>
#include <stdio.h>

#ifndef _MSC_VER
Expand Down Expand Up @@ -41,7 +42,6 @@
#endif

#include "getopt.h"
#include "tuklib_gettext.h"
#include "tuklib_progname.h"
#include "tuklib_mbstr_nonprint.h"
#include "tuklib_exit.h"
Expand Down Expand Up @@ -430,11 +430,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);
Expand Down

0 comments on commit 4b319e0

Please sign in to comment.