-
-
04 Oct 2014 09:11:11 UTC
- Distribution: I18N-Langinfo-Wide
- Module version: 9
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Issues (0)
- Testers (415 / 1 / 0)
- Kwalitee
Bus factor: 1- 88.64% Coverage
- License: gpl_3
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (32.39KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Kevin Ryde
- Dependencies
- Encode
- I18N::Langinfo
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
I18N::Langinfo::Wide -- langinfo functions returning wide-char strings
SYNOPSIS
use I18N::Langinfo 'ABMON_1'; use I18N::Langinfo::Wide 'langinfo'; print langinfo(ABMON_1),"\n"; # "January"
DESCRIPTION
This little module offers a
langinfo()
which is as per I18N::Langinfo but returns wide-char strings rather than locale charset bytes.I18N::Langinfo
usesnl_langinfo()
and so may be available only on Unix/POSIX systems, depending how much the C library might emulate.EXPORTS
Nothing is exported by default, but
langinfo()
can be imported in usual Exporter style. Eg.use I18N::Langinfo::Wide 'langinfo';
There's no
:all
tag, as not sure if it'd be better to import just the new funcs, or everything fromI18N::Langinfo
too.FUNCTIONS
$str = I18N::Langinfo::Wide::langinfo ($what)
-
Return a wide-char string of information for the given
$what
.$what
is an integer, one of the constants fromI18N::Langinfo
likeABDAY_1
.my $what = I18N::Langinfo::ABDAY_1(); print I18N::Langinfo::Wide::langinfo($what); # "Sunday"
As of
I18N::Langinfo
0.02 (Perl 5.10.1), all the return values are character strings. The underlyingnl_langinfo()
function has some byte returns likeGROUPING
, but they're not available through the Perl interface. The intention would be thatI18N::Langinfo::Wide
would leave the byte ones as bytes. $str = I18N::Langinfo::Wide::to_wide ($str)
-
Return
$str
converted to a wide-char string. If$str
is a byte string then it's assumed be in the current locale charset perlanginfo(CODESET)
. If$str
is already wide chars then it's returned unchanged.
BUGS
In the GNU C Library 2.10.1 through 2.17,
langinfo()
onALT_DIGITS
orERA
returns only the first digit or first era. This is a bug in the C library which neitherI18N::Langinfo
norI18N::Langinfo::Wide
attempt to address. (nl_langinfo()
returns nulls\0
between the characters or eras, but the POSIX spec calls for semicolons: http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html.)SEE ALSO
HOME PAGE
http://user42.tuxfamily.org/i18n-langinfo-wide/index.html
LICENSE
I18N-Langinfo-Wide is Copyright 2008, 2009, 2010, 2011, 2014 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/.
Module Install Instructions
To install I18N::Langinfo::Wide, copy and paste the appropriate command in to your terminal.
cpanm I18N::Langinfo::Wide
perl -MCPAN -e shell install I18N::Langinfo::Wide
For more information on module installation, please visit the detailed CPAN module installation guide.