summaryrefslogtreecommitdiff
path: root/gdk/linux-fb
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-10-10 21:54:25 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-10-10 21:54:25 +0000
commitca9158fa031bf1f498b8eaa9fecd4a04ea368ea6 (patch)
treebaf525dd86fa5c66725d3839c590efb17135b8ad /gdk/linux-fb
parent82a3cc699debd3d16e8371d59990d7f4652066ec (diff)
downloadgtk+-ca9158fa031bf1f498b8eaa9fecd4a04ea368ea6.tar.gz
Call setlocale (LC_ALL, ""). (#60606)
Wed Oct 10 12:48:38 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkmain.c (gtk_init_check): Call setlocale (LC_ALL, ""). (#60606) * gtk/gtkmain.c (gtk_disable_setlocale): Add function to disable calling setlocale (LC_ALL, ""). * gtk/gtkmain.c (gtk_set_locale): Indicate in the docs that this function is not typically useful. * gdk/x11/{gdkim-x11.c,gdkmain-x11.c,gdkprivate-x11.h}: Automatically initialize GDK for the current locale on gdk_init(). Don't reset locale to C when XSupportsLocale() fails. * gdk/linux-fb/gdkim-fb.c (gdk_set_locale): Remove useless checks for UTF-8 locale breakage that mattered only for X. * examples/calendar/calendar.c tests/{testgtk.c,testtext.c,testcalendar.c}: Remove calls to gtk_set_locale(). * gtk/gtkiconfactory.c gtk/gtkitemfactory.c: gdk_pixbuf_new_from_stream => gdk_pixbuf_new_from_inline.
Diffstat (limited to 'gdk/linux-fb')
-rw-r--r--gdk/linux-fb/gdkim-fb.c40
1 files changed, 1 insertions, 39 deletions
diff --git a/gdk/linux-fb/gdkim-fb.c b/gdk/linux-fb/gdkim-fb.c
index 7330f40d64..d6e65373bd 100644
--- a/gdk/linux-fb/gdkim-fb.c
+++ b/gdk/linux-fb/gdkim-fb.c
@@ -37,12 +37,6 @@
#include <locale.h>
-/* If this variable is FALSE, it indicates that we should
- * avoid trying to use multibyte conversion functions and
- * assume everything is 1-byte per character
- */
-static gboolean gdk_use_mb;
-
/*
*--------------------------------------------------------------
* gdk_set_locale
@@ -59,42 +53,10 @@ static gboolean gdk_use_mb;
gchar*
gdk_set_locale (void)
{
- wchar_t result;
- gchar *current_locale;
-
- gdk_use_mb = FALSE;
-
if (!setlocale (LC_ALL,""))
g_warning ("locale not supported by C library");
- current_locale = setlocale (LC_ALL, NULL);
-
- if ((strcmp (current_locale, "C")) && (strcmp (current_locale, "POSIX")))
- {
- gdk_use_mb = TRUE;
-
-#ifndef X_LOCALE
- /* Detect GNU libc, where mb == UTF8. Not useful unless it's
- * really a UTF8 locale. The below still probably will
- * screw up on Greek, Cyrillic, etc, encoded as UTF8.
- */
-
- if ((MB_CUR_MAX == 2) &&
- (mbstowcs (&result, "\xdd\xa5", 1) > 0) &&
- result == 0x765)
- {
- if ((strlen (current_locale) < 4) ||
- g_strcasecmp (current_locale + strlen(current_locale) - 4, "utf8"))
- gdk_use_mb = FALSE;
- }
-#endif /* X_LOCALE */
- }
-
- GDK_NOTE (MISC,
- g_message ("%s multi-byte string functions.",
- gdk_use_mb ? "Using" : "Not using"));
-
- return current_locale;
+ return setlocale (LC_ALL, NULL);
}
/*