From d8124a99ae0971ff04d47d31426192ed4bb753b7 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 10 Dec 2012 18:32:25 +0100 Subject: [PATCH] Set the LC_NUMERIC locale category on startup. Previously, for rather unsatisfactory reasons, pspp and psppire set all locale categories except LC_NUMERIC. The reasons for doing this have now been resolved. So this change sets all locale categories including LC_NUMERIC. --- src/libpspp/i18n.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/libpspp/i18n.c b/src/libpspp/i18n.c index 0819299d37..754c9321f3 100644 --- a/src/libpspp/i18n.c +++ b/src/libpspp/i18n.c @@ -545,12 +545,7 @@ recode_substring_pool (const char *to, const char *from, void i18n_init (void) { - setlocale (LC_CTYPE, ""); - setlocale (LC_COLLATE, ""); - setlocale (LC_MESSAGES, ""); -#if HAVE_LC_PAPER - setlocale (LC_PAPER, ""); -#endif + setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, relocate(locale_dir)); textdomain (PACKAGE); @@ -598,7 +593,6 @@ set_encoding_from_locale (const char *loc) ok = false; } - setlocale (LC_CTYPE, tmp); free (tmp); @@ -660,9 +654,6 @@ get_system_decimal (void) { char radix_char; - char *ol = xstrdup (setlocale (LC_NUMERIC, NULL)); - setlocale (LC_NUMERIC, ""); - #if HAVE_NL_LANGINFO radix_char = nl_langinfo (RADIXCHAR)[0]; #else @@ -673,10 +664,6 @@ get_system_decimal (void) } #endif - /* We MUST leave LC_NUMERIC untouched, since it would - otherwise interfere with data_{in,out} */ - setlocale (LC_NUMERIC, ol); - free (ol); return radix_char; } -- 2.30.2