From d9df09cce88e38c129319aa5dedde17d1e329190 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 8 Jan 2002 21:59:32 +0000 Subject: For PR libgcj/5031: * java/lang/natSystem.cc (init_properties): Use LC_MESSAGES to choose default locale. From-SVN: r48664 --- libjava/ChangeLog | 4 ++++ libjava/java/lang/natSystem.cc | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'libjava') diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 7fb1e54..aa91329 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,9 @@ 2002-01-08 Tom Tromey + For PR libgcj/5031: + * java/lang/natSystem.cc (init_properties): Use LC_MESSAGES to + choose default locale. + * Makefile.in: Rebuilt. * Makefile.am (jv_convert_LDADD): Removed convert_source_files. diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc index f970ee6..8f06538 100644 --- a/libjava/java/lang/natSystem.cc +++ b/libjava/java/lang/natSystem.cc @@ -415,7 +415,12 @@ java::lang::System::init_properties (void) // Set user locale properties based on setlocale() #ifdef HAVE_SETLOCALE - char *locale = setlocale (LC_ALL, ""); + // We let the user choose the locale. However, since Java differs + // from POSIX, we arbitrarily pick LC_MESSAGES as determining the + // Java locale. We can't use LC_ALL because it might return a full + // list of all the settings. + setlocale (LC_ALL, ""); + char *locale = setlocale (LC_MESSAGES, ""); if (locale && strlen (locale) >= 2) { char buf[3]; -- cgit v1.1