summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2002-04-22 18:18:38 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-04-22 18:18:38 +0000
commit5fd4fb96f7f54f20be2bfeec646703edeab4c674 (patch)
tree3263658a5614c9c9bb50b4304c3a42f1fc055406 /src/main.c
parent1d818b7b7c6bcd7e2e075b5c392b635e832a4878 (diff)
downloadmetacity-5fd4fb96f7f54f20be2bfeec646703edeab4c674.tar.gz
metacity-5fd4fb96f7f54f20be2bfeec646703edeab4c674.tar.bz2
call setlocale ourselves because due to a GLib bug that sticks us in ASCII
2002-04-22 Havoc Pennington <hp@redhat.com> * src/main.c (main): call setlocale ourselves because due to a GLib bug that sticks us in ASCII if you call g_print or anything prior to setlocale, and print a warning if we don't set the locale successfully. #79280 * src/workspace.c (meta_workspace_get_work_area): be more verbose about how the work area was computed, to help find bugs here. * src/main.c (main): put locale and codeset in the log file
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 2634bf6..509a161 100644
--- a/src/main.c
+++ b/src/main.c
@@ -73,6 +73,11 @@ main (int argc, char **argv)
gboolean disable_sm;
const char *prev_arg;
const char *save_file;
+
+ g_set_prgname (argv[0]);
+
+ if (setlocale (LC_ALL, "") == NULL)
+ meta_warning ("Locale not understood by C library, internationalization will not work\n");
sigemptyset (&empty_mask);
act.sa_handler = SIG_IGN;
@@ -84,19 +89,24 @@ main (int argc, char **argv)
if (sigaction (SIGXFSZ, &act, 0) < 0)
g_printerr ("Failed to register SIGXFSZ handler: %s\n", strerror (errno));
#endif
-
- g_set_prgname (argv[0]);
-
- bindtextdomain (GETTEXT_PACKAGE, METACITY_LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
if (g_getenv ("METACITY_VERBOSE"))
meta_set_verbose (TRUE);
if (g_getenv ("METACITY_DEBUG"))
meta_set_debugging (TRUE);
meta_set_syncing (g_getenv ("METACITY_SYNC") != NULL);
+
+ {
+ const char *charset;
+ g_get_charset (&charset);
+ meta_verbose ("Running in locale \"%s\" with encoding \"%s\"\n",
+ setlocale (LC_ALL, NULL), charset);
+ }
+ bindtextdomain (GETTEXT_PACKAGE, METACITY_LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+ textdomain (GETTEXT_PACKAGE);
+
/* Parse options lamely */
display_name = NULL;