Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Perl, Gtk2 and locale — a bit of a mess

by choroba (Bishop)
on Jul 11, 2013 at 13:26 UTC ( #1043721=note: print w/replies, xml ) Need Help??

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

The documentation of POSIX uses a different way to refer to locale subtypes: constants.
perl -we 'use locale; use POSIX; POSIX::setlocale(POSIX::LC_NUMERIC, " +hu_HU.UTF-8"); printf qq{%f\n}, 123.456;'

Note: Tested with cs_CZ locale, as hu_HU is not installed here.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Perl, Gtk2 and locale — a bit of a mess
by Ralesk (Pilgrim) on Jul 11, 2013 at 13:31 UTC

    Yeah, sorry, just noticed that; if anything it doesn't change a thing.

    More precisely, this is what happens in the code now:

    use POSIX qw/strftime setlocale/; BEGIN { ## To hopefully make it happen way before Gtk2 init setlocale(POSIX::LC_ALL(), "en_US.UTF-8"); } use Glib qw/FALSE TRUE/; use Gtk2 -init;

    And on my coworker’s computer (who uses Hungarian locale to begin with, on Fedora, GTK 3 desktop), we get commas, on my computer (English locale, KDE desktop, but in the shell the locale is set to Hungarian) we get periods.

    Except this is only with the software we’re making. The example one-liners above work identically on both machines.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1043721]
[Corion]: I see that I'm slowly becoming one of those persons who I saw as actively preventing work earlier. But I don't want changes when my colleage is the only one there and everybody else is on vacation

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2017-12-13 08:33 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (350 votes). Check out past polls.