From 7ae8f07814b72fb301f57551f9b55a5fbf92bd66 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Fri, 16 Jul 2004 22:01:47 +0000 Subject: [PATCH] Fri Jul 16 17:59:48 2004 Michael Jennings (mej) If $LANG refers to a UTF-8 or similar locale, remove that part. In other words, en_US.utf8 becomes en_US instead. ---------------------------------------------------------------------- SVN revision: 10868 --- ChangeLog | 5 +++++ src/feature.h | 3 +++ src/startup.c | 16 +++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 33f3cf6..7a440df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5236,3 +5236,8 @@ _NET_WM_ICON property. Fixed a couple warnings. ---------------------------------------------------------------------- +Fri Jul 16 17:59:48 2004 Michael Jennings (mej) + +If $LANG refers to a UTF-8 or similar locale, remove that part. In +other words, en_US.utf8 becomes en_US instead. +---------------------------------------------------------------------- diff --git a/src/feature.h b/src/feature.h index 4827ce0..78369d7 100644 --- a/src/feature.h +++ b/src/feature.h @@ -201,6 +201,9 @@ /* Allow option/attribute for Meta to set the 8th bit */ #define META8_OPTION +/* Attempt to deactivate UTF-8 and similar locales. */ +#define NO_UTF8_LOCALE + /********************* Miscellaneous options *********************/ /* To have $DISPLAY and the "\E[7n" response be IP addresses rather than FQDN's */ diff --git a/src/startup.c b/src/startup.c index 2b6cb5e..4f8ba20 100644 --- a/src/startup.c +++ b/src/startup.c @@ -76,7 +76,8 @@ eterm_bootstrap(int argc, char *argv[]) int i; char *val; - static char windowid_string[20], *display_string, *term_string; /* "WINDOWID=\0" = 10 chars, UINT_MAX = 10 chars */ + /* "WINDOWID=\0" = 10 chars, UINT_MAX = 10 chars */ + static char windowid_string[20], *display_string, *term_string; orig_argv0 = argv[0]; @@ -311,6 +312,19 @@ eterm_bootstrap(int argc, char *argv[]) } putenv("ETERM_VERSION=" VERSION); +#ifdef NO_UTF8_LOCALE + /* Check locale for UTF-8 and deactivate if needed. */ + val = getenv("LANG"); + if (val && *val) { + char *tmp; + + tmp = strcasestr(val, ".utf"); + if (tmp) { + *tmp = 0; + } + } +#endif + D_CMD(("init_command()\n")); init_command(rs_exec_args);