I'm setting the global locale by taking the current locale (C) and overriding the collate and ctype categories with the en_US.UTF-8 locale: locale::global(locale(locale(),"en_US.UTF-8",locale::collate|locale::ctype)) When I actually view the resulting locale with locale().name() or setlocale(LC_ALL,0), I see the following: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C Note that LC_TIME reports its locale has been overridden and LC_COLLATE does not. --------------------- % gcc -v Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux Thread model: posix gcc version 4.1.1 20060525 (Red Hat 4.1.1-1)
Created attachment 12324 [details] Test case to reproduce the problem
Working on it.
Subject: Bug 29217 Author: paolo Date: Wed Sep 27 07:08:13 2006 New Revision: 117247 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117247 Log: 2006-09-27 Paolo Carlini <pcarlini@suse.de> PR libstdc++/29217 * src/localename.cc (locale::_Impl::_M_replace_categories)): Compensate for the inconsistent numerical encodings of the collate and time categories vs the corresponding names. * testsuite/22_locale/locale/cons/29217.cc: New. * testsuite/22_locale/locale/cons/2.cc: Enable and split out the few ENC_TRAITS bits to... * testsuite/22_locale/locale/cons/unicode/1.cc... here. Added: trunk/libstdc++-v3/testsuite/22_locale/locale/cons/29217.cc trunk/libstdc++-v3/testsuite/22_locale/locale/cons/unicode/ trunk/libstdc++-v3/testsuite/22_locale/locale/cons/unicode/1.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/src/localename.cc trunk/libstdc++-v3/testsuite/22_locale/locale/cons/2.cc
Fixed for 4.2.0.
Subject: Bug 29217 Author: paolo Date: Thu Sep 28 14:40:12 2006 New Revision: 117282 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117282 Log: 2006-09-28 Paolo Carlini <pcarlini@suse.de> PR libstdc++/29217 * include/bits/locale_classes.h: Fix (swap) numerical encodings of time and collate categories. * src/locale_init.cc: Consistently reorder locale::_Impl::_S_id_time and _S_id_collate. * src/locale.cc: Tweak. Modified: branches/libstdcxx_so_7-branch/libstdc++-v3/include/bits/locale_classes.h branches/libstdcxx_so_7-branch/libstdc++-v3/src/locale.cc branches/libstdcxx_so_7-branch/libstdc++-v3/src/locale_init.cc
Subject: Bug 29217 Author: paolo Date: Thu Sep 28 14:40:46 2006 New Revision: 117283 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117283 Log: 2006-09-28 Paolo Carlini <pcarlini@suse.de> PR libstdc++/29217 * include/bits/locale_classes.h: Fix (swap) numerical encodings of time and collate categories. * src/locale_init.cc: Consistently reorder locale::_Impl::_S_id_time and _S_id_collate. * src/locale.cc: Tweak. Modified: branches/libstdcxx_so_7-branch/libstdc++-v3/ChangeLog.libstdcxx_so_7-branch