[Bug libstdc++/29217] New: locale confusion with time/collate categories

jjowdy at levanta dot com gcc-bugzilla@gcc.gnu.org
Mon Sep 25 18:54:00 GMT 2006


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)


-- 
           Summary: locale confusion with time/collate categories
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jjowdy at levanta dot com
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29217



More information about the Gcc-bugs mailing list