summaryrefslogtreecommitdiffstats
path: root/gcc/toplev.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 1e98568d7b3..572532f0749 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -4525,9 +4525,16 @@ main (argc, argv)
--p;
progname = p;
+/* LC_CTYPE determines the character set used by the terminal so it has be set
+ to output messages correctly. */
+
#ifdef HAVE_LC_MESSAGES
+ setlocale (LC_CTYPE, "");
setlocale (LC_MESSAGES, "");
+#else
+ setlocale (LC_ALL, "");
#endif
+
(void) bindtextdomain (PACKAGE, localedir);
(void) textdomain (PACKAGE);
OpenPOWER on IntegriCloud