in reply to Re: Perl, Gtk2 and locale — a bit of a mess
in thread Perl, Gtk2 and locale — a bit of a mess

What does the POSIX standard say should happen? What does your system say setlocale should do?

The setlocale link talks about  POSIX::setlocale( LC_ALL , "" ) setting stuff like you're seeing, but in perl its the default  Usage: POSIX::setlocale(category, locale = 0)

To query you use NULL, perls equivalent is

$ perl -e " use POSIX qw/ setlocale LC_ALL /; print setlocale( LC_ALL +, undef ); " English_United States.1252

So I don't think I'm seeing a bug here, looks like its working as designed

Replies are listed 'Best First'.
Re^3: Perl, Gtk2 and locale — a bit of a mess (POSIX)
by Ralesk (Pilgrim) on Jul 15, 2013 at 10:12 UTC

    POSIX(3pm) says that the Perl equivalent of C’s setlocale(cat, NULL) is setlocale($cat) (i.e. one argument). I’m not explicitly setting the locale to the environment-given locale (setlocale($cat, "") or in C setlocale(cat, "")) until later in the code, so it should default to C locale.

        I found this, after looking around on that horrible RT. Hmm.

Re^3: Perl, Gtk2 and locale — a bit of a mess (POSIX)
by Ralesk (Pilgrim) on Jul 15, 2013 at 10:20 UTC

    Also, setlocale(3) says the following: “If locale {the second param} is NULL, the current locale is only queried, not modified. On startup of the main program, the portable "C" locale is selected as default. A program may be made portable to all locales by calling setlocale(LC_ALL, "" ) after program initialization”