Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

locale confusion

by phenom (Chaplain)
on Apr 24, 2005 at 13:16 UTC ( #450941=perlquestion: print w/ replies, xml ) Need Help??
phenom has asked for the wisdom of the Perl Monks concerning the following question:

Hello all,

What I would like is to enable users to view (letters|characters) in their native format (for my Tk/Gtk2 programs). I've read this, this, this, this, perllocale, and more, and I'm still not understanding.

On my end, so long as I have the line "use encoding 'utf8'" in there, I can see things just fine (screenshot). However, users with other locale/language settings (ie., cp1251, ru_RU.CP1251) are unable to do so. Again, unlike the examples I've seen, I do not know in advance what their settings are.

Given the other nodes, will adding the following help?

use locale; use POSIX qw/locale_h/; my $encoding = setlocale(LC_CTYPE); setlocale(LC_CTYPE, $encoding);

Comment on locale confusion
Download Code
Re: locale confusion
by zentara (Archbishop) on Apr 25, 2005 at 12:58 UTC
    Hi, you might find some clues from this gtk2 tutorial

    Dov's gtk2 tutorial

    Although I've had trouble getting his unicode example to display properly. He uses a BEGIN block to set locale.


    I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://450941]
Approved by castaway
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2014-08-28 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls