mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2025-12-20 03:10:03 +01:00
Call setlocale in main function
If setlocale isn't called, GNU gettext will try to convert translated text to ASCII because the default locale is C. It isn't always possible and it causes question marks to be shown on FreeBSD.
This commit is contained in:
parent
2ad16fa7ac
commit
38936b2b2a
1 changed files with 6 additions and 0 deletions
6
main.c
6
main.c
|
|
@ -28,6 +28,7 @@
|
|||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
#define STRICT
|
||||
|
|
@ -494,6 +495,11 @@ main (int argc, char **argv)
|
|||
GError *error = NULL;
|
||||
GOptionContext *opt_context;
|
||||
|
||||
setlocale (LC_CTYPE, "");
|
||||
#ifdef LC_MESSAGES
|
||||
setlocale (LC_MESSAGES, "");
|
||||
#endif
|
||||
|
||||
/* This is here so that we get debug spew from the start,
|
||||
* during arg parsing
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue