Encode::Locale - Determine the locale encoding
use Encode::Locale; use Encode; $string = decode(locale => $octets);
Perl uses Unicode to represent strings internally but many of the interfaces it has to the outside world is still byte based. Programs therefore needs to decode strings that enter the program from the outside and encode them again on the way out.
The POSIX locale system is used to specify both the language conventions to use and the prefered character set to consume and output. This module looks up the charset (called a CODESET in the locale jargon) and arrange for the Encode module to know this encoding under the name "locale".
In addition the following functions and variables are provided:
This will decode the command line arguments to perl (the @ARGV array) in-place.
@ARGV
The encoding name determined to be suitable for the current locale.
I18N::Langinfo, Encode
Copyright 2010 Gisle Aas <gisle@aas.no>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Encode::Locale, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Encode::Locale
CPAN shell
perl -MCPAN -e shell install Encode::Locale
For more information on module installation, please visit the detailed CPAN module installation guide.