diff options
author | Ting-Wei Lan <lantw@src.gnome.org> | 2019-06-23 22:37:54 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw@src.gnome.org> | 2019-06-23 22:37:54 +0800 |
commit | 38936b2b2af7a97d8e3c251c22aed09cd83b1981 (patch) | |
tree | 0cdfc8bc4811441fe2166ad2aef898ca9e2e9bc4 | |
parent | 2ad16fa7ac9e951bfd8982835df1e7ea5c9ffb57 (diff) | |
download | pkg-config-38936b2b2af7a97d8e3c251c22aed09cd83b1981.tar.gz |
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.
-rw-r--r-- | main.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 */ |