Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Is there a variable or function that returns the native platform encoding (APR_LOCALE_CHARSET)

by ELISHEVA (Prior)
on Feb 01, 2009 at 13:56 UTC ( #740533=perlquestion: print w/ replies, xml ) Need Help??
ELISHEVA has asked for the wisdom of the Perl Monks concerning the following question:

In the subversion C/C++ API one of the function parameters defaults to a "locale encoding" which apparently is the native encoding used by the platform where the subversion client is running. I've been trying to find out how to use Perl to tell me the "locale" encoding and I'm having no luck. I'm sure I'm just not looking in the right place, but I wonder if one of the esteemed monks would be willing to tell me where this little tidbit is hiding.

So far I have tried:

Many thanks in advance, beth

Note: the subversion perl API does have such a function, called svn_locale_charset(), located in core.i. I'm interested in a pure Perl equivalent.

Note2:The ideal would be platform independent (works on all Perl supported systems), but a stop-gap would be a collection of OS-specific functions that I could wrap together with some OS detection code.

Comment on Is there a variable or function that returns the native platform encoding (APR_LOCALE_CHARSET)
Re: Is there a variable or function equivalent to APR_LOCALE_CHARSET (native platform encoding)
by cdarke (Prior) on Feb 01, 2009 at 14:10 UTC
    POSIX::setlocale, which not only sets, but can also query the locale.
      Thanks!

      That's the locale, which isn't quite the same thing as the IANA name of the character set (I think). How do I get from the return value of setlocale(...) to the encoding? POSIX::localeconv(..) only gives me numeric formatting conventions.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2014-11-21 20:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (117 votes), past polls