I18N::Langinfo::Wide -- POSIX functions returning wide-char strings
use I18N::Langinfo 'ABMON_1'; use I18N::Langinfo::Wide 'langinfo'; print langinfo(ABMON_1),"\n"; # "January"
This little module offers a wide-char
langinfo, converting the locale charset bytes from
Nothing is exported by default, but
langinfo can be imported in usual
Exporter style. Eg.
use I18N::Langinfo::Wide 'langinfo';
:all tag yet, as not sure if it'd be better to import just the new funcs, or everything from
$str = I18N::Langinfo::Wide::langinfo ($what)
Return a wide-char string of information for the given
$what is an integer, one of the constants from
my $what = I18N::Langinfo::ABDAY_1(); print I18N::Langinfo::Wide::langinfo($what); # "Sunday"
I18N::Langinfo 0.02 (Perl 5.10.1), all the return values are character strings. The underlying
nl_langinfo function has some byte returns like
GROUPING, but they're not available through the Perl interface. The intention is that
I18N::Langinfo::Wide would leave the byte ones as bytes.
$str = I18N::Langinfo::Wide::to_wide ($str)
$str converted to a wide-char string. If
$str is a byte string then it's assumed be in the current locale charset per
$str is already wide chars then it's returned unchanged.
In the GNU C Library 2.10.1,
ERA returns only the first digit or first era. This is a bug in the C library which neither
I18N::Langinfo::Wide attempt to address. (
nl_langinfo returns nulls
\0 between the characters or eras, where the POSIX spec calls for semicolons.)
I18N-Langinfo-Wide is Copyright 2008, 2009, 2010 Kevin Ryde
I18N-Langinfo-Wide is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
I18N-Langinfo-Wide is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with I18N-Langinfo-Wide. If not, see <http://www.gnu.org/licenses/>.