view release on metacpan or search on metacpan
{
die archive_error_string($aw), "\n";
}
}
}
Unicode
Libarchive deals with two types of string like data. Pathnames, user
and group names are proper strings and are encoded in the codeset for
the current POSIX locale. Content data for files stored and retrieved
from in raw bytes.
The usual operational procedure in Perl is to convert everything on
input into UTF-8, operate on the UTF-8 data and then convert (if
necessary) everything on output to the desired output format.
In order to get useful string data out of libarchive, this module
translates its input/output using the codeset for the current POSIX
locale. So you must be using a POSIX locale that supports the
characters in the pathnames of the archives you are going to process,
and it is highly recommend that you use a UTF-8 locale, which should
cover everything.
use strict;
use warnings;
use utf8;
use Archive::Libarchive::XS qw( :all );
use POSIX qw( setlocale LC_ALL );
# substitute en_US.utf8 for the correct UTF-8 locale for your region.
setlocale(LC_ALL, "en_US.utf8"); # or 'export LANG=en_US.utf8' from your shell.
my $entry = archive_entry_new();
archive_entry_set_pathname($entry, "пÑивеÑ.txt");
my $string = archive_entry_pathname($entry); # "пÑивеÑ.txt"
archive_entry_free($entry);
If you try to pass a string with characters unsupported by your current
locale, the behavior is undefined. If you try to retrieve strings with
characters unsupported by your current locale you will get undef.
Unfortunately locale names are not portable across systems, so you
should probably not hard code the locale as shown here unless you know
the correct locale name for all the platforms that your script will
run.
There are two Perl only functions that give information about the
current codeset as understood by libarchive. archive_perl_utf8_mode if
the currently selected codeset is UTF-8.
use strict;
use warnings;
use Archive::Libarchive::XS qw( :all );
die "must use UTF-8 locale" unless archive_perl_utf8_mode();
archive_perl_codeset returns the currently selected codeset.
use strict;
use warnings;
use Archive::Libarchive::XS qw( :all );
my $entry = archive_entry_new();
if(archive_perl_codeset() =~ /^(ISO-8859-5|CP1251|KOI8-R|UTF-8)$/)
CONTRIBUTING file for traps, hints and pitfalls.
CAVEATS
Archive and entry objects are really pointers to opaque C structures
and need to be freed using one of archive_read_free, archive_write_free
or archive_entry_free, in order to free the resources associated with
those objects.
Proper Unicode (or non-ASCII character support) depends on setting the
correct POSIX locale, which is system dependent.
The documentation that comes with libarchive is not that great (by its
own admission), being somewhat incomplete, and containing a few subtle
errors. In writing the documentation for this distribution, I borrowed
heavily (read: stole wholesale) from the libarchive documentation,
making changes where appropriate for use under Perl (changing NULL to
undef for example, along with the interface change to make that work).
I may and probably have introduced additional subtle errors. Patches to
the documentation that match the implementation, or fixes to the
implementation so that it matches the documentation (which ever is
inc/XS.pm.template view on Meta::CPAN
# EXAMPLE: example/constructing_objects_on_disk.pl
=head2 A complete extractor
# EXAMPLE: example/complete_extractor.pl
=head2 Unicode
Libarchive deals with two types of string like data. Pathnames, user and
group names are proper strings and are encoded in the codeset for the
current POSIX locale. Content data for files stored and retrieved from in
raw bytes.
The usual operational procedure in Perl is to convert everything on input
into UTF-8, operate on the UTF-8 data and then convert (if necessary)
everything on output to the desired output format.
In order to get useful string data out of libarchive, this module translates
its input/output using the codeset for the current POSIX locale. So you must
be using a POSIX locale that supports the characters in the pathnames of
the archives you are going to process, and it is highly recommend that you
use a UTF-8 locale, which should cover everything.
use strict;
use warnings;
use utf8;
use Archive::Libarchive::XS qw( :all );
use POSIX qw( setlocale LC_ALL );
# substitute en_US.utf8 for the correct UTF-8 locale for your region.
setlocale(LC_ALL, "en_US.utf8"); # or 'export LANG=en_US.utf8' from your shell.
my $entry = archive_entry_new();
archive_entry_set_pathname($entry, "пÑивеÑ.txt");
my $string = archive_entry_pathname($entry); # "пÑивеÑ.txt"
archive_entry_free($entry);
If you try to pass a string with characters unsupported by your
current locale, the behavior is undefined. If you try to retrieve
strings with characters unsupported by your current locale you will
get C<undef>.
Unfortunately locale names are not portable across systems, so you should
probably not hard code the locale as shown here unless you know the correct
locale name for all the platforms that your script will run.
There are two Perl only functions that give information about the
current codeset as understood by libarchive.
L<archive_perl_utf8_mode|Archive::Libarchive::XS::Function#archive_perl_utf8_mode>
if the currently selected codeset is UTF-8.
use strict;
use warnings;
use Archive::Libarchive::XS qw( :all );
die "must use UTF-8 locale" unless archive_perl_utf8_mode();
L<archive_perl_codeset|Archive::Libarchive::XS::Function#archive_perl_codeset>
returns the currently selected codeset.
use strict;
use warnings;
use Archive::Libarchive::XS qw( :all );
my $entry = archive_entry_new();
inc/XS.pm.template view on Meta::CPAN
=head1 CAVEATS
Archive and entry objects are really pointers to opaque C structures
and need to be freed using one of
L<archive_read_free|Archive::Libarchive::XS::Function#archive_read_free>,
L<archive_write_free|Archive::Libarchive::XS::Function#archive_write_free> or
L<archive_entry_free|Archive::Libarchive::XS::Function#archive_entry_free>,
in order to free the resources associated with those objects.
Proper Unicode (or non-ASCII character support) depends on setting the
correct POSIX locale, which is system dependent.
The documentation that comes with libarchive is not that great (by its own
admission), being somewhat incomplete, and containing a few subtle errors.
In writing the documentation for this distribution, I borrowed heavily (read:
stole wholesale) from the libarchive documentation, making changes where
appropriate for use under Perl (changing C<NULL> to C<undef> for example, along
with the interface change to make that work). I may and probably have introduced
additional subtle errors. Patches to the documentation that match the
implementation, or fixes to the implementation so that it matches the
documentation (which ever is appropriate) would greatly appreciated.
lib/Archive/Libarchive/XS.pm view on Meta::CPAN
{
die archive_error_string($aw), "\n";
}
}
}
=head2 Unicode
Libarchive deals with two types of string like data. Pathnames, user and
group names are proper strings and are encoded in the codeset for the
current POSIX locale. Content data for files stored and retrieved from in
raw bytes.
The usual operational procedure in Perl is to convert everything on input
into UTF-8, operate on the UTF-8 data and then convert (if necessary)
everything on output to the desired output format.
In order to get useful string data out of libarchive, this module translates
its input/output using the codeset for the current POSIX locale. So you must
be using a POSIX locale that supports the characters in the pathnames of
the archives you are going to process, and it is highly recommend that you
use a UTF-8 locale, which should cover everything.
use strict;
use warnings;
use utf8;
use Archive::Libarchive::XS qw( :all );
use POSIX qw( setlocale LC_ALL );
# substitute en_US.utf8 for the correct UTF-8 locale for your region.
setlocale(LC_ALL, "en_US.utf8"); # or 'export LANG=en_US.utf8' from your shell.
my $entry = archive_entry_new();
archive_entry_set_pathname($entry, "пÑивеÑ.txt");
my $string = archive_entry_pathname($entry); # "пÑивеÑ.txt"
archive_entry_free($entry);
If you try to pass a string with characters unsupported by your
current locale, the behavior is undefined. If you try to retrieve
strings with characters unsupported by your current locale you will
get C<undef>.
Unfortunately locale names are not portable across systems, so you should
probably not hard code the locale as shown here unless you know the correct
locale name for all the platforms that your script will run.
There are two Perl only functions that give information about the
current codeset as understood by libarchive.
L<archive_perl_utf8_mode|Archive::Libarchive::XS::Function#archive_perl_utf8_mode>
if the currently selected codeset is UTF-8.
use strict;
use warnings;
use Archive::Libarchive::XS qw( :all );
die "must use UTF-8 locale" unless archive_perl_utf8_mode();
L<archive_perl_codeset|Archive::Libarchive::XS::Function#archive_perl_codeset>
returns the currently selected codeset.
use strict;
use warnings;
use Archive::Libarchive::XS qw( :all );
my $entry = archive_entry_new();
lib/Archive/Libarchive/XS.pm view on Meta::CPAN
=head1 CAVEATS
Archive and entry objects are really pointers to opaque C structures
and need to be freed using one of
L<archive_read_free|Archive::Libarchive::XS::Function#archive_read_free>,
L<archive_write_free|Archive::Libarchive::XS::Function#archive_write_free> or
L<archive_entry_free|Archive::Libarchive::XS::Function#archive_entry_free>,
in order to free the resources associated with those objects.
Proper Unicode (or non-ASCII character support) depends on setting the
correct POSIX locale, which is system dependent.
The documentation that comes with libarchive is not that great (by its own
admission), being somewhat incomplete, and containing a few subtle errors.
In writing the documentation for this distribution, I borrowed heavily (read:
stole wholesale) from the libarchive documentation, making changes where
appropriate for use under Perl (changing C<NULL> to C<undef> for example, along
with the interface change to make that work). I may and probably have introduced
additional subtle errors. Patches to the documentation that match the
implementation, or fixes to the implementation so that it matches the
documentation (which ever is appropriate) would greatly appreciated.
lib/Archive/Libarchive/XS.xs view on Meta::CPAN
struct archive *archive
struct archive_entry *entry
#endif
=head2 archive_perl_codeset
my $string = archive_perl_codeset();
Returns the name of the "codeset" (character encoding, example: "UTF-8" for
UTF-8 or "ANSI_X3.4-1968" for ASCII) of the currently configured locale.
=cut
#if HAS_archive_perl_codeset
string_or_null
archive_perl_codeset()
#endif
lib/Archive/Libarchive/XS/Function.pod view on Meta::CPAN
my $bool = archive_match_time_excluded($archive, $entry);
Test if a file is excluded by its time stamp.
=head2 archive_perl_codeset
my $string = archive_perl_codeset();
Returns the name of the "codeset" (character encoding, example: "UTF-8" for
UTF-8 or "ANSI_X3.4-1968" for ASCII) of the currently configured locale.
=head2 archive_perl_utf8_mode
my $bool = archive_perl_utf8_mode();
Returns true if the internal "codeset" used by libarchive is UTF-8.
=head2 archive_read_append_filter
my $status = archive_read_append_filter($archive, $code)
t/common_unicode.t view on Meta::CPAN
use strict;
use warnings;
use utf8;
use open ':std', ':encoding(utf8)';
use Test::More;
use Archive::Libarchive::XS qw( :all );
plan skip_all => 'test requires unicode locale' unless archive_perl_utf8_mode();
plan tests => 2;
my $e = archive_entry_new();
my $r = archive_entry_set_pathname($e, "пÑивеÑ.txt");
is $r, ARCHIVE_OK, 'archive_entry_set_pathname';
is archive_entry_pathname($e), "пÑивеÑ.txt", 'archive_entry_pathname';
xs/ppport.h view on Meta::CPAN
AHOCORASICK|5.009005||Viu
AHOCORASICKC|5.009005||Viu
alloccopstash|5.017001|5.017001|x
alloc_LOGOP|5.025004||xViu
allocmy|5.008001||Viu
ALLOC_THREAD_KEY|5.005003||Viu
ALT_DIGITS|5.027010||Viu
amagic_call|5.003007|5.003007|u
amagic_cmp|5.009003||Viu
amagic_cmp_desc|5.031010||Viu
amagic_cmp_locale|5.009003||Viu
amagic_cmp_locale_desc|5.031010||Viu
amagic_deref_call|5.013007|5.013007|u
amagic_i_ncmp|5.009003||Viu
amagic_i_ncmp_desc|5.031010||Viu
amagic_is_enabled|5.015008||Viu
amagic_ncmp|5.009003||Viu
amagic_ncmp_desc|5.031010||Viu
AMG_CALLun|5.003007||Viu
AMG_CALLunary|5.013009||Viu
AMGfallNEVER|5.003007||Viu
AMGfallNO|5.003007||Viu
xs/ppport.h view on Meta::CPAN
cGVOP_gv|5.006000||Viu
cGVOPo_gv|5.006000||Viu
cGVOPx_gv|5.006000||Viu
change_engine_size|5.029004||Viu
CHANGE_MULTICALL_FLAGS|5.018000||Viu
CHARBITS|5.011002|5.011002|Vn
CHARSET_PAT_MODS|5.013010||Viu
chdir|5.005000||Viu
checkcomma|5.003007||Viu
check_end_shift|5.009005||Viu
check_locale_boundary_crossing|5.015006||Viu
CHECK_MALLOC_TAINT|5.008001||Viu
CHECK_MALLOC_TOO_LATE_FOR|5.008001||Viu
check_offset_max|5.005000||Viu
check_offset_min|5.005000||Viu
check_substr|5.005000||Viu
check_type_and_open|5.009003||Viu
check_uni|5.003007||Viu
check_utf8|5.008000||Viu
check_utf8_print|5.013009||Viu
child_offset_bits|5.009003||Viu
xs/ppport.h view on Meta::CPAN
CLUMP_2IV|5.006000||Viu
CLUMP_2UV|5.006000||Viu
CLUMP|5.006000||Viu
cMETHOPx|5.021005||Viu
cMETHOPx_meth|5.021005||Viu
cMETHOPx_rclass|5.021007||Viu
cmpchain_extend|5.031010||Viu
cmpchain_finish|5.031010||Viu
cmpchain_start|5.031010||Viu
cmp_desc|5.031010||Viu
cmp_locale_desc|5.031010||Viu
cntrl_to_mnemonic|5.021004||cVniu
CODESET|5.027010||Viu
COMBINING_DOT_ABOVE_UTF8|5.029008||Viu
COMBINING_GRAVE_ACCENT_UTF8|5.017004||Viu
COMMIT|5.009005||Viu
COMMIT_next|5.009005||Viu
COMMIT_next_fail|5.009005||Viu
compile_wildcard|5.031009||Viu
compute_EXACTish|5.017003||Vniu
COND_BROADCAST|5.005000||Viu
xs/ppport.h view on Meta::CPAN
dXSBOOTARGSXSAPIVERCHK|5.021006||Viu
dXSFUNCTION|5.005000||Viu
dXSI32|5.003007|5.003007|V
dXSTARG|5.006000|5.003007|poVnu
dXSUB_SYS|5.003007||Viu
edit_distance|5.023008||Vniu
EIGHT_BIT_UTF8_TO_NATIVE|5.023003||Viu
ELEMENT_RANGE_MATCHES_INVLIST|5.023002||Viu
EMBEDMYMALLOC|5.006000||Viu
emulate_cop_io|||xciu
emulate_setlocale|5.027009||Vniu
END|5.003007||Viu
END_EXTERN_C|5.005000|5.003007|pV
endgrent|5.009000||Viu
ENDGRENT_R_HAS_FPTR|5.008000||Viu
ENDGRENT_R_PROTO|5.008000|5.008000|Vn
endhostent|5.005000||Viu
ENDHOSTENT_R_PROTO|5.008000|5.008000|Vn
ENDLIKE|5.009005||Viu
endnetent|5.005000||Viu
ENDNETENT_R_PROTO|5.008000|5.008000|Vn
xs/ppport.h view on Meta::CPAN
float_substr|5.005000||Viu
float_utf8|5.008000||Viu
flock|5.005000||Viu
flockfile|5.003007||Viu
F_log_amg|5.004000||Viu
FmLINES|5.003007||Viu
fold_constants|5.003007||Viu
foldEQ|5.013002|5.013002|n
foldEQ_latin1|5.013008||cVnu
foldEQ_latin1_s2_folded|5.029007||Vniu
foldEQ_locale|5.013002|5.013002|n
FOLDEQ_LOCALE|5.019009||Viu
FOLDEQ_S1_ALREADY_FOLDED|5.015004||Viu
FOLDEQ_S1_FOLDS_SANE|5.021008||Viu
FOLDEQ_S2_ALREADY_FOLDED|5.015004||Viu
FOLDEQ_S2_FOLDS_SANE|5.021008||Viu
foldEQ_utf8|5.013002|5.007003|p
foldEQ_utf8_flags|5.013010||cVu
FOLDEQ_UTF8_NOMIX_ASCII|5.013010||Viu
FOLD_FLAGS_FULL|5.015006||Viu
FOLD_FLAGS_LOCALE|5.015006||Viu
xs/ppport.h view on Meta::CPAN
I32SIZE|5.006000|5.006000|Vn
I32TYPE|5.006000|5.006000|Vn
I64SIZE|5.006000|5.006000|Vn
I64TYPE|5.006000|5.006000|Vn
I8SIZE|5.006000|5.006000|Vn
I8_TO_NATIVE|5.015006||Viu
I8_TO_NATIVE_UTF8|5.019004||Viu
I8TYPE|5.006000|5.006000|Vn
I_ARPA_INET|5.005000|5.005000|Vn
ibcmp|5.003007|5.003007|
ibcmp_locale|5.004000|5.004000|
ibcmp_utf8|5.007003|5.007003|
I_CRYPT|5.008000|5.008000|Vn
I_DBM|5.031006|5.031006|Vn
I_DIRENT|5.003007|5.003007|Vn
I_DLFCN|5.003007|5.003007|Vn
I_EXECINFO|5.021001|5.021001|Vn
I_FENV|5.021004|5.021004|Vn
IFMATCH|5.003007||Viu
IFMATCH_A|5.009005||Viu
IFMATCH_A_fail|5.009005||Viu
xs/ppport.h view on Meta::CPAN
isIDFIRST_LC|5.004000|5.004000|p
isIDFIRST_LC_utf8|5.006000||Viu
isIDFIRST_LC_utf8_safe|5.025009|5.006000|p
isIDFIRST_LC_uvchr|5.007001|5.007001|
isIDFIRST_uni|5.006000||Viu
isIDFIRST_utf8|5.031005|5.031005|
isIDFIRST_utf8_safe|5.025009|5.006000|p
isIDFIRST_uvchr|5.023009|5.006000|p
isinfnan|5.021004|5.021004|n
isinfnansv|5.021005||Vi
_is_in_locale_category|5.021001||cViu
is_invariant_string|5.021007|5.011000|pn
is_invlist|5.029002||Vniu
is_LAX_VERSION|5.011004||Viu
isLB|5.023007||Viu
isLEXWARN_off|5.006000||Viu
isLEXWARN_on|5.006000||Viu
is_LNBREAK_latin1_safe|5.009005||Viu
is_LNBREAK_safe|5.009005||Viu
is_LNBREAK_utf8_safe|5.009005||Viu
isLOWER|5.003007|5.003007|p
xs/ppport.h view on Meta::CPAN
PERL_SCAN_SILENT_ILLDIGIT|5.008001|5.003007|p
PERL_SCAN_SILENT_NON_PORTABLE|5.015001||Viu
PERL_SCAN_SILENT_OVERFLOW|5.031009||Viu
PERL_SCAN_TRAILING|5.021002|5.021002|
PERL_SCNfldbl|5.006001|5.006001|Vn
PERL_SCRIPT_MODE|5.004005||Viu
PERL_SEEN_HV_FUNC_H|5.017010||Viu
PERL_SEEN_HV_MACRO_H|5.027001||Viu
PERL_SET_CONTEXT|5.006000||Viu
PERL_SET_INTERP|5.006000||Viu
Perl_setlocale|5.027002|5.027002|n
PERL_SET_PHASE|5.015001||Viu
PERL_SET_THX|5.006000||Viu
Perl_sharepvn|5.006000||Viu
PERL_SHORT_MAX|5.003007|5.003007|p
PERL_SHORT_MIN|5.003007|5.003007|p
PERLSI_DESTROY|5.005000||Viu
PERLSI_DIEHOOK|5.005000||Viu
PERL_SIGNALS_UNSAFE_FLAG|5.008001|5.003007|p
Perl_signbit|5.009005|5.009005|xn
PERLSI_MAGIC|5.005000||Viu
xs/ppport.h view on Meta::CPAN
PL_comppad_name|5.017004|5.017004|x
PL_comppad_name_fill|5.005000||Viu
PL_comppad_name_floor|5.005000||Viu
PL_constpadix|5.021004||Viu
PL_copline||5.003007|ponu
PL_cop_seqmax|5.005000||Viu
PL_cryptseen|5.005000||Viu
PL_cshlen|5.005000||Viu
PL_curcop|5.004005|5.003007|p
PL_curcopdb|5.005000||Viu
PL_curlocales|5.027009||Viu
PL_curpad|5.005000|5.005000|x
PL_curpm|5.005000||Viu
PL_curpm_under|5.025007||Viu
PL_curstack|5.005000||Viu
PL_curstackinfo|5.005000||Viu
PL_curstash|5.004005|5.003007|p
PL_curstname|5.005000||Viu
PL_custom_op_descs|5.007003||Viu
PL_custom_op_names|5.007003||Viu
PL_custom_ops|5.013007||Viu
xs/ppport.h view on Meta::CPAN
PL_in_clean_all|5.005000||Viu
PL_in_clean_objs|5.005000||Viu
PL_in_eval|5.005000||Viu
PL_initav|5.005000||Viu
PL_in_load_module|5.008001||Viu
PL_in_my||5.003007|ponu
PL_in_my_stash||5.005000|ponu
PL_inplace|5.005000||Viu
PL_in_some_fold|5.029007||Viu
PL_internal_random_state|5.027004||Viu
PL_in_utf8_COLLATE_locale|5.025002||Viu
PL_in_utf8_CTYPE_locale|5.019009||Viu
PL_in_utf8_turkic_locale|5.029008||Viu
PL_isarev|5.009005||Viu
PL_keyword_plugin|5.011002|5.011002|x
PL_known_layers|5.007003||Viu
PL_langinfo_buf|5.027004||Viu
PL_langinfo_bufsize|5.027004||Viu
PL_lastfd|5.005000||Viu
PL_lastgotoprobe|5.005000||Viu
PL_last_in_gv|5.005000||Vi
PL_laststatval|5.005000|5.003007|poVnu
PL_laststype|5.005000||Viu
PL_Latin1|5.015008||Viu
PL_LB_invlist|5.023007||Viu
PL_lc_numeric_mutex_depth|5.027009||Viu
PL_lex_state||5.003007|ponu
PL_lex_stuff||5.003007|ponu
PL_linestr||5.003007|ponu
PL_LIO|5.006000||Viu
PL_locale_utf8ness|5.027009||Viu
PL_localizing|5.005000||Viu
PL_localpatches|5.005000||Viu
PL_lockhook|5.007003||Viu
PL_main_cv|5.005000||Viu
PL_main_root|5.005000||Viu
PL_mainstack|5.005000||Viu
PL_main_start|5.005000||Viu
PL_markstack|5.005000||Viu
PL_markstack_max|5.005000||Viu
PL_markstack_ptr|5.005000||Viu
xs/ppport.h view on Meta::CPAN
PL_savestack_ix|5.005000||Viu
PL_savestack_max|5.005000||Viu
PL_sawampersand|5.005000||Viu
PL_SB_invlist|5.021009||Viu
PL_scopestack|5.005000||Viu
PL_scopestack_ix|5.005000||Viu
PL_scopestack_max|5.005000||Viu
PL_scopestack_name|5.011002||Viu
PL_SCX_invlist|5.027008||Viu
PL_secondgv|5.005000||Viu
PL_setlocale_buf|5.027009||Viu
PL_setlocale_bufsize|5.027009||Viu
PL_sharehook|5.007003||Viu
PL_sighandler1p|5.031007||Viu
PL_sighandler3p|5.031007||Viu
PL_sighandlerp|5.005000||Viu
PL_signalhook|5.013002||Viu
PL_signals|5.008001|5.003007|poVnu
PL_sig_pending|5.007001||Viu
PL_Sock|5.006000||Viu
PL_sortcop|5.005000||Viu
PL_sortstash|5.005000||Viu
xs/ppport.h view on Meta::CPAN
PL_unlockhook|5.007003||Viu
PL_unsafe|5.005000||Viu
PL_UpperLatin1|5.019005||Viu
PLUS|5.003007||Viu
PL_utf8cache|5.009004||Viu
PL_utf8_charname_begin|5.017006||Viu
PL_utf8_charname_continue|5.017006||Viu
PL_utf8_foldclosures|5.013007||Viu
PL_utf8_idcont|5.008000||Viu
PL_utf8_idstart|5.008000||Viu
PL_utf8locale|5.008001||Viu
PL_utf8_mark|5.006000||Viu
PL_utf8_perl_idcont|5.017008||Viu
PL_utf8_perl_idstart|5.015004||Viu
PL_utf8_tofold|5.007003||Viu
PL_utf8_tolower|5.006000||Viu
PL_utf8_tosimplefold|5.027011||Viu
PL_utf8_totitle|5.006000||Viu
PL_utf8_toupper|5.006000||Viu
PL_utf8_xidcont|5.013010||Viu
PL_utf8_xidstart|5.013010||Viu
xs/ppport.h view on Meta::CPAN
PL_vtbl_regdatum|5.015000||Viu
PL_vtbl_regexp|5.015000||Viu
PL_vtbl_sigelem|5.015000||Viu
PL_vtbl_substr|5.015000||Viu
PL_vtbl_sv|5.015000||Viu
PL_vtbl_taint|5.015000||Viu
PL_vtbl_utf8|5.015000||Viu
PL_vtbl_uvar|5.015000||Viu
PL_vtbl_vec|5.015000||Viu
PL_warnhook|5.005000||Viu
PL_warn_locale|5.021008||Viu
PL_watchaddr|5.006000||Viu
PL_watchok|5.006000||Viu
PL_WB_invlist|5.021009||Viu
PL_wcrtomb_ps|5.031009||Viu
PL_XPosix_ptrs|5.017008||Viu
PL_Xpv|5.005000|5.003007|poVnu
PL_xsubfilename|5.021006||Viu
pm_description|5.009004||Viu
PMf_BASE_SHIFT|5.013004||Viu
PMf_CHARSET|5.017011||Viu
xs/ppport.h view on Meta::CPAN
pregfree|5.003007|5.003007|u
PREGf_SKIP|5.009005||Viu
PREGf_USE_RE_EVAL|5.017001||Viu
PREGf_VERBARG_SEEN|5.009005||Viu
prepare_SV_for_RV|5.010001||Viu
prescan_version|5.011004|5.011004|
PRESCAN_VERSION|5.019008||Viu
PREVOPER|5.003007||Viu
PREV_RANGE_MATCHES_INVLIST|5.023002||Viu
printbuf|5.009004||Viu
print_bytes_for_locale|5.027002||Viu
print_collxfrm_input_and_return|5.025004||Viu
printf|5.003007||Viu
PRINTF_FORMAT_NULL_OK|5.009005|5.009005|Vn
printf_nocontext|5.007001|5.007001|vdnu
PRIVLIB|5.003007|5.003007|Vn
PRIVLIB_EXP|5.003007|5.003007|Vn
PRIVSHIFT|5.003007||Viu
process_special_blocks|5.009005||Viu
PROCSELFEXE_PATH|5.007003|5.007003|Vn
PRUNE|5.009005||Viu
xs/ppport.h view on Meta::CPAN
re_printf|5.023009||vViu
RE_PV_COLOR_DECL|5.009004||Viu
RE_PV_QUOTED_DECL|5.009004||Viu
require_pv|5.006000|5.006000|
require_tie_mod|5.009005||Viu
ReREFCNT_dec|5.005000||Viu
ReREFCNT_inc|5.005000||Viu
RESTORE_ERRNO|5.010001||Vi
RESTORE_LC_NUMERIC|5.021010|5.021010|p
restore_magic|5.009003||Viu
restore_switched_locale|5.027009||Viu
RE_SV_DUMPLEN|5.009004||Viu
RE_SV_ESCAPE|5.009004||Viu
RE_SV_TAIL|5.009004||Viu
RETPUSHNO|5.003007||Viu
RETPUSHUNDEF|5.003007||Viu
RETPUSHYES|5.003007||Viu
RE_TRACK_PATTERN_OFFSETS|5.009005||Viu
RE_TRIE_MAXBUF_INIT|5.009002||Viu
RE_TRIE_MAXBUF_NAME|5.009002||Viu
RETSETNO|5.003007||Viu
xs/ppport.h view on Meta::CPAN
setfd_inhexec_for_sysfd|5.027008||Viu
setgid|5.005000||Viu
setgrent|5.009000||Viu
SETGRENT_R_HAS_FPTR|5.008000||Viu
SETGRENT_R_PROTO|5.008000|5.008000|Vn
sethostent|5.005000||Viu
SETHOSTENT_R_PROTO|5.008000|5.008000|Vn
SETi|5.003007||Viu
setjmp|5.005000||Viu
setlinebuf|5.005000||Viu
setlocale|5.009000||Viu
setlocale_debug_string|5.027002||Vniu
SETLOCALE_R_PROTO|5.008000|5.008000|Vn
SET_MARK_OFFSET|5.006000||Viu
setmode|5.005000||Viu
SETn|5.003007||Viu
setnetent|5.005000||Viu
SETNETENT_R_PROTO|5.008000|5.008000|Vn
set_numeric_radix|5.006000||Viu
SET_NUMERIC_STANDARD|5.004000||Viu
set_numeric_standard|5.006000||cViu
SET_NUMERIC_UNDERLYING|5.021010||Viu
xs/ppport.h view on Meta::CPAN
SS_ADD_END|5.017007||Viu
SS_ADD_INT|5.017007||Viu
SS_ADD_IV|5.017007||Viu
SS_ADD_LONG|5.017007||Viu
SS_ADD_PTR|5.017007||Viu
SS_ADD_UV|5.017007||Viu
SS_BUFFEROVF|5.021009||Viu
ssc_add_range|5.019005||Viu
ssc_and|5.019005||Viu
ssc_anything|5.019005||Viu
ssc_clear_locale|5.019005||Vniu
ssc_cp_and|5.019005||Viu
ssc_finalize|5.019005||Viu
SSCHECK|5.003007||Viu
ssc_init|5.019005||Viu
ssc_intersection|5.019005||Viu
ssc_is_anything|5.019005||Vniu
ssc_is_cp_posixl_init|5.019005||Vniu
SSC_MATCHES_EMPTY_STRING|5.021004||Viu
ssc_or|5.019005||Viu
ssc_union|5.019005||Viu
xs/ppport.h view on Meta::CPAN
STATUS_NATIVE_CHILD_SET|5.009003||Viu
STATUS_UNIX|5.009003||Viu
STATUS_UNIX_EXIT_SET|5.009003||Viu
STATUS_UNIX_SET|5.009003||Viu
STDCHAR|5.003007|5.003007|Vn
stderr|5.003007||Viu
stdin|5.003007||Viu
STDIO_PTR_LVAL_SETS_CNT|5.007001|5.007001|Vn
STDIO_PTR_LVALUE|5.006000|5.006000|Vn
STDIO_STREAM_ARRAY|5.006000|5.006000|Vn
stdize_locale|5.007001||Viu
stdout|5.003007||Viu
stdoutf|5.005000||Viu
STD_PAT_MODS|5.009005||Viu
STD_PMMOD_FLAGS_CLEAR|5.013006||Viu
ST_INO_SIGN|5.015002|5.015002|Vn
ST_INO_SIZE|5.015002|5.015002|Vn
STMT_END|5.003007|5.003007|pV
STMT_START|5.003007|5.003007|pV
STOREFEATUREBITSHH|5.031006||Viu
STORE_LC_NUMERIC_FORCE_TO_UNDERLYING|5.021010|5.021010|
xs/ppport.h view on Meta::CPAN
SV_CATUTF8|5.021005|5.021005|
sv_catxmlpvs|5.013006||Viu
SV_CHECK_THINKFIRST|5.008001||Viu
SV_CHECK_THINKFIRST_COW_DROP|5.009000||Viu
sv_chop|5.003007|5.003007|
sv_clean_all|5.003007||Vi
sv_clean_objs|5.003007||Vi
sv_clear|5.003007|5.003007|
sv_cmp|5.003007|5.003007|
sv_cmp_flags|5.013006|5.013006|
sv_cmp_locale|5.004000|5.004000|
sv_cmp_locale_flags|5.013006|5.013006|
sv_collxfrm|5.013006||V
sv_collxfrm_flags|5.013006|5.013006|
SvCOMPILED|5.003007||Viu
SvCOMPILED_off|5.003007||Viu
SvCOMPILED_on|5.003007||Viu
SV_CONST|5.019002||Viu
SV_CONST_BINMODE|5.019002||Viu
SV_CONST_CLEAR|5.019002||Viu
SV_CONST_CLOSE|5.019002||Viu
SV_CONST_DELETE|5.019002||Viu
xs/ppport.h view on Meta::CPAN
sv_vcatpvfn_flags|5.017002|5.017002|
SvVOK|5.008001|5.008001|
sv_vsetpvf|5.006000|5.004000|p
sv_vsetpvf_mg|5.006000|5.004000|p
sv_vsetpvfn|5.004000|5.004000|
SvVSTRING_mg|5.009004|5.003007|p
SvWEAKREF|5.006000||Viu
SvWEAKREF_off|5.006000||Viu
SvWEAKREF_on|5.006000||Viu
swallow_bom|5.006001||Viu
switch_category_locale_to_template|5.027009||Viu
SWITCHSTACK|5.003007||Viu
switch_to_global_locale|5.027009|5.003007|pn
sync_locale|5.027009|5.003007|pn
sys_init3|||cnu
sys_init|||cnu
sys_intern_clear|5.006001||Vu
sys_intern_dup|5.006000||Vu
sys_intern_init|5.006001||Vu
SYSTEM_GMTIME_MAX|5.011000||Viu
SYSTEM_GMTIME_MIN|5.011000||Viu
SYSTEM_LOCALTIME_MAX|5.011000||Viu
SYSTEM_LOCALTIME_MIN|5.011000||Viu
sys_term|||cnu
xs/ppport.h view on Meta::CPAN
TARGi|5.023005||Viu
TARGn|5.023005||Viu
TARGu|5.023005||Viu
telldir|5.005000||Viu
T_FMT|5.027010||Viu
T_FMT_AMPM|5.027010||Viu
THIS|5.003007|5.003007|V
THOUSEP|5.027010||Viu
THR|5.005000||Viu
THREAD_CREATE_NEEDS_STACK|5.007002||Viu
thread_locale_init|5.027009|5.027009|xnu
thread_locale_term|5.027009|5.027009|xnu
THREAD_RET_TYPE|5.005000||Viu
tied_method|5.013009||vViu
TIED_METHOD_ARGUMENTS_ON_STACK|5.013009||Viu
TIED_METHOD_MORTALIZE_NOT_NEEDED|5.013009||Viu
TIED_METHOD_SAY|5.013009||Viu
times|5.005000||Viu
Time_t|5.003007|5.003007|Vn
Timeval|5.004000|5.004000|Vn
TM|5.011000||Viu
tmpfile|5.003007||Viu
xs/ppport.h view on Meta::CPAN
WARN_NUMERIC|5.006000|5.003007|p
WARN_ONCE|5.006000|5.003007|p
warn_on_first_deprecated_use|5.025009||Viu
WARN_OVERFLOW|5.006000|5.003007|p
WARN_PACK|5.006000|5.003007|p
WARN_PARENTHESIS|5.006000|5.003007|p
WARN_PIPE|5.006000|5.003007|p
WARN_PORTABLE|5.006000|5.003007|p
WARN_PRECEDENCE|5.006000|5.003007|p
WARN_PRINTF|5.006000|5.003007|p
_warn_problematic_locale|5.021008||cVniu
WARN_PROTOTYPE|5.006000|5.003007|p
WARN_QW|5.006000|5.003007|p
WARN_RECURSION|5.006000|5.003007|p
WARN_REDEFINE|5.006000|5.003007|p
WARN_REDUNDANT|5.021002|5.021002|
WARN_REGEXP|5.006000|5.003007|p
WARN_RESERVED|5.006000|5.003007|p
WARN_SEMICOLON|5.006000|5.003007|p
WARN_SEVERE|5.006000|5.003007|p
WARN_SHADOW|5.027007|5.027007|
xs/ppport.h view on Meta::CPAN
WHILEM_B_max|5.009005||Viu
WHILEM_B_max_fail|5.009005||Viu
WHILEM_B_min|5.009005||Viu
WHILEM_B_min_fail|5.009005||Viu
WIDEST_UTYPE|5.015004|5.003007|p
WIFEXITED|5.008001||Viu
WIFSIGNALED|5.008001||Viu
WIFSTOPPED|5.008001||Viu
win32_croak_not_implemented|5.017006||Vniu
WIN32SCK_IS_STDSCK|5.007001||Viu
win32_setlocale|5.027006||Viu
withinCOUNT|5.031004||Viu
WITH_LC_NUMERIC_SET_TO_NEEDED|5.031003|5.031003|
WITH_LC_NUMERIC_SET_TO_NEEDED_IN|5.031003|5.031003|
with_queued_errors|5.013001||Viu
WNOHANG|5.008001||Viu
wrap_keyword_plugin|5.027006|5.027006|x
wrap_op_checker|5.015008|5.015008|
write|5.005000||Viu
write_to_stderr|5.008001||Viu
WSTOPSIG|5.008001||Viu
xs/ppport.h view on Meta::CPAN
: UTF8_IS_DOWNGRADEABLE_START((s)[0]) \
/* The cast in the line below is only to silence warnings */ \
? is ## macro ## _LC((WIDEST_UTYPE) LATIN1_TO_NATIVE( \
UTF8_ACCUMULATE(NATIVE_UTF8_TO_I8((s)[0]) \
& UTF_START_MASK(2), \
(s)[1]))) \
: is ## macro ## _utf8(s))
/* A few of the early functions are broken. For these and the non-LC case,
* machine generated code is substituted. But that code doesn't work for
* locales. This is just like the above macro, but at the end, we call the
* macro we've generated for the above 255 case, which is correct since locale
* isn't involved. This will generate extra code to handle the 0-255 inputs,
* but hopefully it will be optimized out by the C compiler. But just in case
* it isn't, this macro is only used on the few versions that are broken */
#define D_PPP_IS_GENERIC_LC_UTF8_SAFE_BROKEN(s, e, macro) \
(((e) - (s)) <= 0 \
? 0 \
: UTF8_IS_INVARIANT((s)[0]) \
? is ## macro ## _LC((s)[0]) \
: (((e) - (s)) < UTF8SKIP(s)) \
xs/ppport.h view on Meta::CPAN
/* Hint: isSPACE, isSPACE_A, isSPACE_L1, isSPACE_utf8_safe
Until Perl 5.18, this did not match the vertical tab (VT). The xs/ppport.h
version does match it in all perl releases. Since VT's are extremely rarely
found in real-life files, this difference effectively doesn't matter */
#ifdef EBCDIC
/* This is the first version where these macros are fully correct on EBCDIC
* platforms. Relying on * the C library functions, as earlier releases did,
* causes problems with * locales */
# if (PERL_BCDVERSION < 0x5022000)
# undef isALNUM
# undef isALNUM_A
# undef isALNUM_L1
# undef isALNUMC
# undef isALNUMC_A
# undef isALNUMC_L1
# undef isALPHA
# undef isALPHA_A
# undef isALPHA_L1
xs/ppport.h view on Meta::CPAN
# define isUPPER(c) ( (c) >= 'A' && (c) <= 'Z' \
&& ( (c) <= 'I' \
|| ((c) >= 'J' && (c) <= 'R') \
|| (c) >= 'S'))
#endif
#else /* Above is EBCDIC; below is ASCII */
# if (PERL_BCDVERSION < 0x5004000)
/* The implementation of these in older perl versions can give wrong results if
* the C program locale is set to other than the C locale */
# undef isALNUM
# undef isALNUM_A
# undef isALPHA
# undef isALPHA_A
# undef isDIGIT
# undef isDIGIT_A
# undef isIDFIRST
# undef isIDFIRST_A
# undef isLOWER
# undef isLOWER_A
xs/ppport.h view on Meta::CPAN
if (PL_numeric_radix_sv && IN_LOCALE) {
STRLEN len;
char* radix = SvPV(PL_numeric_radix_sv, len);
if (*sp + len <= send && memEQ(*sp, radix, len)) {
*sp += len;
return TRUE;
}
}
#else
/* older perls don't have PL_numeric_radix_sv so the radix
* must manually be requested from locale.h
*/
#include <locale.h>
dTHR; /* needed for older threaded perls */
struct lconv *lc = localeconv();
char *radix = lc->decimal_point;
if (radix && IN_LOCALE) {
STRLEN len = strlen(radix);
if (*sp + len <= send && memEQ(*sp, radix, len)) {
*sp += len;
return TRUE;
}
}
#endif
#endif /* USE_LOCALE_NUMERIC */
/* always try "." if numeric radix didn't match because
* we may have data from different locales mixed */
if (*sp < send && **sp == '.') {
++*sp;
return TRUE;
}
return FALSE;
}
#endif
#endif
#ifndef grok_number
xs/ppport.h view on Meta::CPAN
# undef STORE_LC_NUMERIC_SET_STANDARD
# undef RESTORE_LC_NUMERIC
# undef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
# ifdef USE_LOCALE
#ifndef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION char *LoC_
#endif
#ifndef STORE_NUMERIC_SET_STANDARD
# define STORE_NUMERIC_SET_STANDARD() \
LoC_ = savepv(setlocale(LC_NUMERIC, NULL)); \
SAVEFREEPV(LoC_); \
setlocale(LC_NUMERIC, "C");
#endif
#ifndef RESTORE_LC_NUMERIC
# define RESTORE_LC_NUMERIC() \
setlocale(LC_NUMERIC, LoC_);
#endif
# else
#ifndef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
# define DECLARATION_FOR_LC_NUMERIC_MANIPULATION
#endif
#ifndef STORE_LC_NUMERIC_SET_STANDARD
# define STORE_LC_NUMERIC_SET_STANDARD()
#endif
xs/ppport.h view on Meta::CPAN
/* The names of these changed in 5.28 */
#ifndef LOCK_LC_NUMERIC_STANDARD
# define LOCK_LC_NUMERIC_STANDARD LOCK_NUMERIC_STANDARD
#endif
#ifndef UNLOCK_LC_NUMERIC_STANDARD
# define UNLOCK_LC_NUMERIC_STANDARD UNLOCK_NUMERIC_STANDARD
#endif
/* If this doesn't exist, it's not needed, so is void noop */
#ifndef switch_to_global_locale
# define switch_to_global_locale()
#endif
/* Originally, this didn't return a value, but in perls like that, the value
* should always be TRUE. Add a return to Perl_sync_locale() when it's
* available. And actually do a sync when its not, if locales are available on
* this system. */
#ifdef sync_locale
# if (PERL_BCDVERSION < 0x5027009)
# if (PERL_BCDVERSION >= 0x5021003)
# undef sync_locale
# define sync_locale() (Perl_sync_locale(aTHX), 1)
# elif defined(sync_locale) /* These should only be the 5.20 maints*/
# undef sync_locale /* Just copy their defn and return 1 */
# define sync_locale() (new_ctype(setlocale(LC_CTYPE, NULL)), \
new_collate(setlocale(LC_COLLATE, NULL)), \
set_numeric_local(), \
new_numeric(setlocale(LC_NUMERIC, NULL)), \
1)
# elif defined(new_ctype) && defined(LC_CTYPE)
# define sync_locale() (new_ctype(setlocale(LC_CTYPE, NULL)), 1)
# endif
# endif
#endif
#ifndef sync_locale
# define sync_locale() 1
#endif
#endif /* _P_P_PORTABILITY_H_ */
/* End of File xs/ppport.h */
xs/unicode.c view on Meta::CPAN
#include <string.h>
#if defined(__CYGWIN__) || !defined(_WIN32)
#include <langinfo.h>
#include <locale.h>
#endif
#include "perl_archive.h"
const char *
archive_perl_codeset(void)
{
#if defined(__CYGWIN__) || !defined(_WIN32)
return nl_langinfo(CODESET);
#else
return "ANSI_X3.4-1968";