view release on metacpan or search on metacpan
use 5.008_001;
use strict;
use warnings;
use utf8;
use Module::Build;
use File::Basename;
use File::Spec;
use CPAN::Meta;
view all matches for this distribution
view release on metacpan or search on metacpan
use 5.008_001;
use strict;
use warnings;
use utf8;
use Module::Build;
use File::Basename;
use File::Spec;
use CPAN::Meta;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/LogFormat/Compiler.pm view on Meta::CPAN
}
1;
__END__
=encoding utf8
=head1 NAME
Apache::LogFormat::Compiler - Compile a log format string to perl-code
view all matches for this distribution
view release on metacpan or search on metacpan
if !defined $a;
return "String b is undef, string a has ".length($a)." characters"
if !defined $b;
}
require utf8;
# hack to cater for perl 5.6
*utf8::is_utf8 = sub { (DBI::neat(shift)=~/^"/) } unless defined &utf8::is_utf8;
my @a_chars = (utf8::is_utf8($a)) ? unpack("U*", $a) : unpack("C*", $a);
my @b_chars = (utf8::is_utf8($b)) ? unpack("U*", $b) : unpack("C*", $b);
my $i = 0;
while (@a_chars && @b_chars) {
++$i, shift(@a_chars), shift(@b_chars), next
if $a_chars[0] == $b_chars[0];# compare ordinal values
my @desc = map {
sub data_string_desc { # describe a data string
my ($a) = @_;
require bytes;
require utf8;
# hacks to cater for perl 5.6
*utf8::is_utf8 = sub { (DBI::neat(shift)=~/^"/) } unless defined &utf8::is_utf8;
*utf8::valid = sub { 1 } unless defined &utf8::valid;
# Give sufficient info to help diagnose at least these kinds of situations:
# - valid UTF8 byte sequence but UTF8 flag not set
# (might be ascii so also need to check for hibit to make it worthwhile)
# - UTF8 flag set but invalid UTF8 byte sequence
# could do better here, but this'll do for now
my $utf8 = sprintf "UTF8 %s%s",
utf8::is_utf8($a) ? "on" : "off",
utf8::valid($a||'') ? "" : " but INVALID encoding";
return "$utf8, undef" unless defined $a;
my $is_ascii = $a =~ m/^[\000-\177]*$/;
return sprintf "%s, %s, %d characters %d bytes",
$utf8, $is_ascii ? "ASCII" : "non-ASCII",
length($a), bytes::length($a);
}
sub connect_test_perf {
Strings will be quoted, although internal quotes will I<not> be escaped.
Values known to be numeric will be unquoted. Undefined (NULL) values
will be shown as C<undef> (without quotes).
If the string is flagged internally as utf8 then double quotes will
be used, otherwise single quotes are used and unprintable characters
will be replaced by dot (.).
For result strings longer than C<$maxlen> the result string will be
truncated to C<$maxlen-4> and "C<...'>" will be appended. If C<$maxlen> is 0
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/PageKit/View.pm view on Meta::CPAN
# my $template_file = $view->_find_template($pkit_view, $page_id);
my ( $lang_tmpl, $skip_xpath_content ) = $content->process_template($page_id, $template_ref);
# find the right converter for perl < 5.8.0
# if we skip the xpath content, the string is in $default_input_charset.
# otherwise it is in utf8 ( from libxml2 )
my $converter;
my $default_output_charset = $view->{default_output_charset};
if ( $skip_xpath_content ) {
my $default_input_charset = $view->{default_input_charset};
unless ( lc $default_input_charset eq lc $default_output_charset) {
lib/Apache/PageKit/View.pm view on Meta::CPAN
}
}
else {
unless ( /^utf-?8$/i =~ $default_output_charset) {
eval {
$converter = Text::Iconv->new( 'utf8', $default_output_charset);
};
if ($@) {
(my $config_dir = $view->{content_dir}) =~ s!/Content$!/Config!;
die "The conversion from ('utf8' => $default_output_charset) is not supported by Text::Iconv please check file ${config_dir}/Config.xml";
}
}
}
}
lib/Apache/PageKit/View.pm view on Meta::CPAN
# my $template_file = $view->_find_template($pkit_view, $page_id);
my ( $lang_tmpl, $skip_xpath_content ) = $content->process_template($page_id, $template_ref);
# find the right converter for perl < 5.8.0
# if we skip the xpath content, the string is in $default_input_charset.
# otherwise it is in utf8 ( from libxml2 )
my $converter;
my $default_output_charset = $view->{default_output_charset};
if ( $skip_xpath_content ) {
my $default_input_charset = $view->{default_input_charset};
unless ( lc $default_input_charset eq lc $default_output_charset) {
lib/Apache/PageKit/View.pm view on Meta::CPAN
}
}
else {
unless ( /^utf-?8$/i =~ $default_output_charset) {
eval {
$converter = Text::Iconv->new( 'utf8', $default_output_charset);
};
if ($@) {
(my $config_dir = $view->{content_dir}) =~ s!/Content$!/Config!;
die "The conversion from ('utf8' => $default_output_charset) is not supported by Text::Iconv please check file ${config_dir}/Config.xml";
}
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/RSS/Encoding/JcodeUTF8.pm view on Meta::CPAN
use Jcode;
use base qw(Apache::RSS::Encoding);
sub encode {
my($self, $str) = @_;
return Jcode->new(\$str)->utf8;
}
1;
__END__
=head1 NAME
Apache::RSS::Encoding::JcodeUTF8 - encode Japanese <title>..</title> string to utf8.
=head1 SYNOPSIS
RSSScanHTMLTitle On
RSSEncodeHandler Apache::RSS::Encoding::JcodeUTF8
view all matches for this distribution
view release on metacpan or search on metacpan
use strict;
use warnings;
use Apache::Request 0.32;
use Carp;
use Encode qw(decode_utf8 encode_utf8);
our @ISA = 'Apache::Request';
our $VERSION = '0.08';
return $self->parms if !wantarray && !@_;
# Encode everything back to UTF-8. (The second argument may be an
# array reference.)
my @args = map ref($_)
? [ map encode_utf8($_), @$_ ]
: encode_utf8($_),
@_;
# param() is context-sensitive
if (wantarray) {
return map decode_utf8($_), $self->SUPER::param(@args);
} else {
return decode_utf8 scalar $self->SUPER::param(@args);
}
}
sub parms {
my $self = shift;
# Our core decode/encode functions. If encode_parms is empty, we still need
# to encode to UTF-8, since libapreq won't handle wide characters.
sub _decode { Encode::decode($_[2] || $_[0]->decode_parms, $_[1]) }
sub _encode { Encode::encode($_[0]->encode_parms || 'utf8', $_[1]) }
# Handling of Content-Disposition parameter values (form field names and
# filenames in multipart/form-data) is a bit tricky. RFC 2047 clearly states
# (section 5) that parameter values cannot contain any encoded-word; however,
# RFC 1867 actually recommended using encoded-word for such purposes, and
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/SWIT/DB/Connection.pm view on Meta::CPAN
use Apache::SWIT::DB::ST;
use Carp;
__PACKAGE__->mk_classdata('Instance');
__PACKAGE__->mk_classdata('DBIArgs', { PrintError => 0
, AutoCommit => 1, pg_enable_utf8 => 1
, HandleError => sub { confess($_[0]); }
, RootClass => 'Apache::SWIT::DB::ST', });
__PACKAGE__->mk_accessors(qw(db_handle pid));
view all matches for this distribution
view release on metacpan or search on metacpan
demo/httpdconf/httpd.sec2.conf view on Meta::CPAN
AddCharset CP866 .cp866
AddCharset ISO-8859-5 .iso-ru
AddCharset KOI8-R .koi8-r
AddCharset UCS-2 .ucs2
AddCharset UCS-4 .ucs4
AddCharset UTF-8 .utf8
# LanguagePriority allows you to give precedence to some languages
# in case of a tie during content negotiation.
#
# Just list the languages in decreasing order of preference. We have
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Session/Browseable.pm view on Meta::CPAN
L<Apache::Session>, L<http://lemonldap-ng.org>,
L<https://lemonldap-ng.org/documentation/2.0/performances#performance_test>
=head1 COPYRIGHT AND LICENSE
=encoding utf8
Copyright (C):
=over
view all matches for this distribution
view release on metacpan or search on metacpan
t/Apache-Session-MongoDB.t view on Meta::CPAN
# change 'tests => 1' to 'tests => last_test_to_print';
use strict;
use warnings;
use utf8;
use Test::More tests => 24;
BEGIN { use_ok('Apache::Session::MongoDB') }
#########################
t/Apache-Session-MongoDB.t view on Meta::CPAN
ok( tie( %h, 'Apache::Session::MongoDB', undef, $args ), 'New object' );
my $id;
ok( $id = $h{_session_id}, '_session_id is defined' );
$h{some} = 'data';
$h{utf8} = 'éà èÅ';
$h{'dotted.key'} = 'test';
$h{'dollar$key'} = 'test';
untie %h;
t/Apache-Session-MongoDB.t view on Meta::CPAN
),
'Access to previous session'
);
ok( $h2{some} eq 'data', 'Find data' );
ok( $h2{utf8} eq 'éà èÅ', 'UTF string' );
ok( $h2{'dotted.key'} eq 'test', 'Dotted key' );
ok( $h2{'dollar$key'} eq 'test', 'Dollar key' );
Apache::Session::MongoDB->get_key_from_all_sessions($args);
#binmode(STDERR, ":utf8");
#print STDERR $h2{utf8}."\n";
# Create a few sessions to test deleteIfLowerThan
my @delSessions;
push @delSessions,
newsession( $args, type => "persistent", ttl => 100 ),
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Solr.pm view on Meta::CPAN
unless exists $p{commit};
if(defined $p{string})
{ # try to avoid copying the data, which can be huge
$data = $ct =~ m!^text/!i
? \encode(utf8 =>
(ref $p{string} eq 'SCALAR' ? ${$p{string}} : $p{string}))
: (ref $p{string} eq 'SCALAR' ? $p{string} : \$p{string} );
delete $p{string};
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/TestHandler.pm view on Meta::CPAN
}
1;
__END__
=encoding utf8
=head1 NAME
Apache::TestHandler - a few response handlers and helpers
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/Tika.pm view on Meta::CPAN
use strict;
use warnings;
package Apache::Tika;
use Encode qw/decode_utf8/;
use LWP::UserAgent;
use JSON::MaybeXS();
our $VERSION = '0.07';
lib/Apache/Tika.pm view on Meta::CPAN
);
# Check for errors
# TODO
return decode_utf8($response->decoded_content(charset => 'none'));
}
sub meta {
my ($self, $bytes, $contentType) = @_;
my $meta = $self->_request(
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache/WebDAV.pm view on Meta::CPAN
my $href = $doc->createElement('D:href');
$href->appendText(
File::Spec->catdir(
map { uri_escape encode_utf8 $_ } File::Spec->splitdir($path)
)
);
$resp->addChild($href);
lib/Apache/WebDAV.pm view on Meta::CPAN
-> running `basic':
0. init.................. pass
1. begin................. pass
2. options............... pass
3. put_get............... pass
4. put_get_utf8_segment.. pass
5. mkcol_over_plain...... pass
6. delete................ pass
7. delete_null........... pass
8. delete_fragment....... WARNING: DELETE removed collection resource with Request-URI including fragment; unsafe
...................... pass (with 1 warning)
view all matches for this distribution
view release on metacpan or search on metacpan
Wyrd/Services/Index.pm view on Meta::CPAN
use 5.006;
use strict;
use warnings;
no warnings qw(uninitialized);
our $VERSION = '0.98';
use Apache::Wyrd::Services::SAK qw(token_parse strip_html utf8_force utf8_to_entities);
use Apache::Wyrd::Services::SearchParser;
use BerkeleyDB;
use BerkeleyDB::Btree;
use Digest::SHA qw(sha1_hex);
use Carp;
Wyrd/Services/Index.pm view on Meta::CPAN
}
sub index_map {
my ($self, $attribute_name, $id, $data) = @_;
use Encode qw(_utf8_off);
_utf8_off($data);
#warn "mapping $id - $attribute : " . join (':', @$data);
my $attribute = $self->attributes->{$attribute_name};
my (%unique, $item, @items) = (); # for unique-ifying word list
#remove duplicates if necessary
if (ref($data) eq 'ARRAY') {
Wyrd/Services/Index.pm view on Meta::CPAN
=cut
sub clean_html {
my ($self, $data) = @_;
$data = strip_html($data);
$data = utf8_force($data);
$data = lc($data);
$data =~ s/\p{IsM}/ /gs; # Strip M_arks
$data =~ s/\p{IsP}/ /gs; # Strip P_unct
$data =~ s/\p{IsZ}/ /gs; # Strip S(Z_)eparators
$data =~ s/\p{IsC}+/ /sg; # Flatten all whitespace & C_ontrol characters
$data =~ s/^[\p{IsC} ]+//s; #Remove leading whitespace
$data =~ s/[\p{IsC} ]+$//s; #Remove trailing whitespace
$data =~ s/\+//g;
$data = utf8_to_entities($data); #Encode all multibyte sequences to entities
$data =~ s/([\x00-\x08\x0B\x0C\x0E-\x1F\x80-\xFF])/'&#x' . sprintf('%X', ord($1)) . ';'/gexs; #Encode all single-byte "unusual" characters
return $data;
}
sub clean_searchstring {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/API.pm view on Meta::CPAN
my $hash;
# try-catch
local $@;
eval
{
$hash = $json->utf8->decode( $raw );
};
if( $@ )
{
return( $self->error( "An error occurred while trying to decode json payload: $@" ) );
}
lib/Apache2/API.pm view on Meta::CPAN
{
my $self = shift( @_ );
return( APR::Request::decode( shift( @_ ) ) );
}
sub decode_utf8
{
my $self = shift( @_ );
my $v = shift( @_ );
my $rv = eval
{
## utf8 is more lax than the strict standard of utf-8; see Encode man page
Encode::decode( 'utf8', $v, Encode::FB_CROAK );
};
if( $@ )
{
$self->error( "Error while decoding text: $@" );
return( $v );
lib/Apache2/API.pm view on Meta::CPAN
{
my $self = shift( @_ );
return( APR::Request::encode( shift( @_ ) ) );
}
sub encode_utf8
{
my $self = shift( @_ );
my $v = shift( @_ );
my $rv = eval
{
## utf8 is more lax than the strict standard of utf-8; see Encode man page
Encode::encode( 'utf8', $v, Encode::FB_CROAK );
};
if( $@ )
{
$self->error( "Error while encoding text: $@" );
return( $v );
lib/Apache2/API.pm view on Meta::CPAN
return( $dt );
}
sub is_perl_option_enabled { return( shift->_try( 'request', 'is_perl_option_enabled', @_ ) ); }
# We return a new object each time, because if we cached it, some routine might set the utf8 bit flagged on while some other would not want it
sub json
{
my $self = shift( @_ );
my $opts = $self->_get_args_as_hash( @_ );
my $j = JSON->new;
lib/Apache2/API.pm view on Meta::CPAN
{
$self->response->headers->unset( 'Content-Encoding' );
# $self->response->content_encoding( undef() );
# $r->send_http_header;
# $r->print( $json );
# $json = Encode::encode_utf8( $json ) if( utf8::is_utf8( $json ) );
# try-catch
local $@;
eval
{
my $bytes = $r->print( $json );
lib/Apache2/API.pm view on Meta::CPAN
my $r = $self->apache_request;
if( $code !~ /^[0-9]+$/ )
{
$self->response->code( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
$self->response->rflush;
$self->response->print( $self->json->utf8->encode({ error => 'An unexpected server error occured', code => 500 }) );
$self->error( "http code to be used '$code' is invalid. It should be only integers." );
return( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
}
if( ref( $ref ) ne 'HASH' )
{
$self->response->code( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
$self->response->rflush;
# $r->send_http_header;
$self->response->print( $self->json->utf8->encode({ error => 'An unexpected server error occured', code => 500 }) );
$self->error( "Data provided to send is not an hash ref." );
return( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
}
my $msg;
lib/Apache2/API.pm view on Meta::CPAN
$self->request->request->pool->cleanup_register( $cleanup, $self );
# $r->push_handlers( PerlCleanupHandler => $cleanup );
}
# Our print() will possibly change the HTTP headers, so we do not flush now just yet.
my $json = $self->json->utf8->relaxed(0)->allow_blessed->convert_blessed->encode( $ref );
# Before we use this, we have to make sure all Apache module that deal with content encoding are de-activated because they would interfere
$self->print( $json ) || do
{
return( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
};
lib/Apache2/API.pm view on Meta::CPAN
# 100kb
$api->compression_threshold(102400);
my $decoded = $api->decode_base64( $b64_string );
my $ref = $api->decode_json( $json_data );
my $decoded = $api->decode_url;
my $perl_utf8 = $api->decode_utf8( $data );
my $b64_string = $api->encode_base64( $data );
my $json_data = $api->encode_json( $ref );
my $encoded = $api->encode_url( $uri );
my $utf8 = $api->encode_utf8( $data );
my $uuid = $api->generate_uuid;
my $auth = $api->get_auth_bearer;
my $handlers = $api->get_handlers;
my $dt = $api->header_datetime( $http_datetime );
my $bool = $api->is_perl_option_enabled;
lib/Apache2/API.pm view on Meta::CPAN
Given some data, this will decode it using base64 algorithm. It uses L<APR::Base64/decode> in the background.
=head2 decode_json( $data )
This decode from utf8 some data into a perl structure using L<JSON>
If an error occurs, it will return undef and set an exception that can be accessed with the L<error|Module::Generic/error> method.
=head2 decode_url( $string )
Given a url-encoded string, this returns the decoded string using L<APR::Request/decode>
=head2 decode_utf8( $data )
Decode some data from ut8 into perl internal utf8 representation using L<Encode>
If an error occurs, it will return undef and set an exception that can be accessed with the L<error|Module::Generic/errir> method.
=head2 encode_base64( $data )
lib/Apache2/API.pm view on Meta::CPAN
=head2 encode_json( $hash_reference )
Given a hash reference, this will encode it into a json data representation.
However, this will not utf8 encode it, because this is done upon printing the data and returning it to the client.
The JSON object has the following properties enabled: C<allow_nonref>, C<allow_blessed>, C<convert_blessed> and C<relaxed>
=head2 encode_url( $string )
Given a string, this returns its url-encoded version using L<APR::Request/encode>
=head2 encode_utf8( $data )
This encode in ut8 the data provided and return it.
If an error occurs, it will return undef and set an exception that can be accessed with the B<error> method.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/ASP/Server.pm view on Meta::CPAN
package Apache2::ASP::Server;
use strict;
use warnings 'all';
use Mail::Sendmail;
use encoding 'utf8';
#==============================================================================
sub new
{
lib/Apache2/ASP/Server.pm view on Meta::CPAN
{
my ($s, $todecode) = @_;
return unless defined($todecode);
$todecode =~ tr/+/ /; # pluses become spaces
$todecode =~ s/%(?:([0-9a-fA-F]{2})|u([0-9a-fA-F]{4}))/
defined($1)? chr hex($1) : _utf8_chr(hex($2))/ge;
return $todecode;
}# end URLDecode()
#==============================================================================
lib/Apache2/ASP/Server.pm view on Meta::CPAN
$s->context->get_prop('r')->pool->cleanup_register( $sub, \@args );
}# end RegisterCleanup()
#==============================================================================
sub _utf8_chr
{
my ($c) = @_;
require utf8;
my $u = chr($c);
utf8::encode($u); # drop utf8 flag
return $u;
}# end _utf8_chr()
#==============================================================================
sub DESTROY
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/AuthAny/DB.pm view on Meta::CPAN
my $dsn = "database=$dbName";
my $dbHost = $ENV{AUTH_ANY_DB_HOST};
$dsn .= ";host=$dbHost" if $dbHost;
$dbHandle = DBI->connect("DBI:$db:$dsn", $dbUser, $dbPassword) or die "user: $dbUser, errstr: $DBI::errstr";
$dbHandle->do('SET CHARACTER SET utf8');
}
bless ($self, $class);
return $self;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/Banner.pm view on Meta::CPAN
}
1;
__END__
=encoding utf8
=head1 NAME
Apache2::Banner - a patch for Apache2::ServerUtil
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/Controller.pm view on Meta::CPAN
package Apache2::Controller;
=encoding utf8
=head1 NAME
Apache2::Controller - fast MVC-style Apache2 handler apps
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/HTML/Detergent.pm view on Meta::CPAN
my $uri = URI->new
(sprintf '%s://%s:%d%s', $scheme,
$host, $port, $r->unparsed_uri)->canonical;
$r->log->debug($uri);
my $utf8 = Encode::decode(Detect => $content);
$content = $utf8 if defined $utf8 and ($content ne '' and $utf8 ne '');
undef $utf8;
if ($type =~ m!/.*xml!i) {
$r->log->debug("Attempting to use XML parser for $uri");
$content = eval {
XML::LibXML->load_xml
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/ModLogConfig.pm view on Meta::CPAN
}
1;
__END__
=encoding utf8
=head1 NAME
Apache2::ModLogConfig - a Perl interface to mod_log_config
view all matches for this distribution
view release on metacpan or search on metacpan
PERL_MAGIC_sv|5.007002||p
PERL_MAGIC_taint|5.007002||p
PERL_MAGIC_tiedelem|5.007002||p
PERL_MAGIC_tiedscalar|5.007002||p
PERL_MAGIC_tied|5.007002||p
PERL_MAGIC_utf8|5.008001||p
PERL_MAGIC_uvar_elem|5.007003||p
PERL_MAGIC_uvar|5.007002||p
PERL_MAGIC_vec|5.007002||p
PERL_MAGIC_vstring|5.008001||p
PERL_PV_ESCAPE_ALL|5.009004||p
SvPVbyte_force||5.009002|
SvPVbyte_nolen||5.006000|
SvPVbytex_force||5.006000|
SvPVbytex||5.006000|
SvPVbyte|5.006000||p
SvPVutf8_force||5.006000|
SvPVutf8_nolen||5.006000|
SvPVutf8x_force||5.006000|
SvPVutf8x||5.006000|
SvPVutf8||5.006000|
SvPVx|||
SvPV|||
SvREFCNT_dec|||
SvREFCNT_inc_NN|5.009004||p
SvREFCNT_inc_simple_NN|5.009004||p
block_start|||
boolSV|5.004000||p
boot_core_PerlIO|||
boot_core_UNIVERSAL|||
boot_core_mro|||
bytes_from_utf8||5.007001|
bytes_to_uni|||n
bytes_to_utf8||5.006001|
call_argv|5.006000||p
call_atexit||5.006000|
call_list||5.004000|
call_method|5.006000||p
call_pv|5.006000||p
do_spawn|||
do_sprintf|||
do_sv_dump||5.006000|
do_sysseek|||
do_tell|||
do_trans_complex_utf8|||
do_trans_complex|||
do_trans_count_utf8|||
do_trans_count|||
do_trans_simple_utf8|||
do_trans_simple|||
do_trans|||
do_vecget|||
do_vecset|||
do_vop|||
hv_store_flags||5.008000|
hv_stores|5.009004||p
hv_store|||
hv_undef|||
ibcmp_locale||5.004000|
ibcmp_utf8||5.007003|
ibcmp|||
incline|||
incpush_if_exists|||
incpush_use_sep|||
incpush|||
is_uni_space||5.006000|
is_uni_upper_lc||5.006000|
is_uni_upper||5.006000|
is_uni_xdigit_lc||5.006000|
is_uni_xdigit||5.006000|
is_utf8_alnumc||5.006000|
is_utf8_alnum||5.006000|
is_utf8_alpha||5.006000|
is_utf8_ascii||5.006000|
is_utf8_char_slow|||n
is_utf8_char||5.006000|
is_utf8_cntrl||5.006000|
is_utf8_common|||
is_utf8_digit||5.006000|
is_utf8_graph||5.006000|
is_utf8_idcont||5.008000|
is_utf8_idfirst||5.006000|
is_utf8_lower||5.006000|
is_utf8_mark||5.006000|
is_utf8_print||5.006000|
is_utf8_punct||5.006000|
is_utf8_space||5.006000|
is_utf8_string_loclen||5.009003|
is_utf8_string_loc||5.008001|
is_utf8_string||5.006001|
is_utf8_upper||5.006000|
is_utf8_xdigit||5.006000|
isa_lookup|||
items|||n
ix|||n
jmaybe|||
join_exact|||
magic_setpos|||
magic_setregexp|||
magic_setsig|||
magic_setsubstr|||
magic_settaint|||
magic_setutf8|||
magic_setuvar|||
magic_setvec|||
magic_set|||
magic_sizepack|||
magic_wipepack|||
my_strlcpy|5.009004||pn
my_swabn|||n
my_swap|||
my_unexec|||
my_vsnprintf||5.009004|n
need_utf8|||n
newANONATTRSUB||5.006000|
newANONHASH|||
newANONLIST|||
newANONSUB|||
newASSIGNOP|||
newSVnv|||
newSVpvf_nocontext|||vn
newSVpvf||5.004000|v
newSVpvn_flags|5.011000||p
newSVpvn_share|5.007001||p
newSVpvn_utf8|5.011000||p
newSVpvn|5.004050||p
newSVpvs_flags|5.011000||p
newSVpvs_share||5.009003|
newSVpvs|5.009003||p
newSVpv|||
sv_2nv|||
sv_2pv_flags|5.007002||p
sv_2pv_nolen|5.006000||p
sv_2pvbyte_nolen|5.006000||p
sv_2pvbyte|5.006000||p
sv_2pvutf8_nolen||5.006000|
sv_2pvutf8||5.006000|
sv_2pv|||
sv_2uv_flags||5.009001|
sv_2uv|5.004000||p
sv_add_arena|||
sv_add_backref|||
sv_insert|||
sv_isa|||
sv_isobject|||
sv_iv||5.005000|
sv_kill_backrefs|||
sv_len_utf8||5.006000|
sv_len|||
sv_magic_portable|5.011000|5.004000|p
sv_magicext||5.007003|
sv_magic|||
sv_mortalcopy|||
sv_pvbyte||5.006000|
sv_pvn_force_flags|5.007002||p
sv_pvn_force|||
sv_pvn_nomg|5.007003|5.005000|p
sv_pvn||5.005000|
sv_pvutf8n_force||5.006000|
sv_pvutf8n||5.006000|
sv_pvutf8||5.006000|
sv_pv||5.006000|
sv_recode_to_utf8||5.007003|
sv_reftype|||
sv_release_COW|||
sv_replace|||
sv_report_used|||
sv_reset|||
sv_untaint||5.004000|
sv_upgrade|||
sv_usepvn_flags||5.009004|
sv_usepvn_mg|5.004050||p
sv_usepvn|||
sv_utf8_decode||5.006000|
sv_utf8_downgrade||5.006000|
sv_utf8_encode||5.006000|
sv_utf8_upgrade_flags_grow||5.011000|
sv_utf8_upgrade_flags||5.007002|
sv_utf8_upgrade_nomg||5.007002|
sv_utf8_upgrade||5.007001|
sv_uv|5.005000||p
sv_vcatpvf_mg|5.006000|5.004000|p
sv_vcatpvfn||5.004000|
sv_vcatpvf|5.006000|5.004000|p
sv_vsetpvf_mg|5.006000|5.004000|p
to_uni_lower||5.007003|
to_uni_title_lc||5.006000|
to_uni_title||5.007003|
to_uni_upper_lc||5.006000|
to_uni_upper||5.007003|
to_utf8_case||5.007003|
to_utf8_fold||5.007003|
to_utf8_lower||5.007003|
to_utf8_substr|||
to_utf8_title||5.007003|
to_utf8_upper||5.007003|
token_free|||
token_getmad|||
tokenize_use|||
tokeq|||
tokereport|||
unsharepvn||5.004000|
unwind_handler_stack|||
update_debugger_info|||
upg_version||5.009005|
usage|||
utf16_to_utf8_reversed||5.006001|
utf16_to_utf8||5.006001|
utf8_distance||5.006000|
utf8_hop||5.006000|
utf8_length||5.007001|
utf8_mg_pos_cache_update|||
utf8_to_bytes||5.006001|
utf8_to_uvchr||5.007001|
utf8_to_uvuni||5.007001|
utf8n_to_uvchr|||
utf8n_to_uvuni||5.007001|
utilize|||
uvchr_to_utf8_flags||5.007003|
uvchr_to_utf8|||
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
#ifndef newSVpvn
# define newSVpvn(data,len) ((data) \
? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
: newSV(0))
#endif
#ifndef newSVpvn_utf8
# define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
#endif
#ifndef SVf_UTF8
# define SVf_UTF8 0
#endif
#if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
char *
DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
{
sv_utf8_downgrade(sv,0);
return SvPV(sv,*lp);
}
#endif
#ifndef PERL_MAGIC_vec
# define PERL_MAGIC_vec 'v'
#endif
#ifndef PERL_MAGIC_utf8
# define PERL_MAGIC_utf8 'w'
#endif
#ifndef PERL_MAGIC_substr
# define PERL_MAGIC_substr 'x'
#endif
const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
char octbuf[32] = "%123456789ABCDF";
STRLEN wrote = 0;
STRLEN chsize = 0;
STRLEN readsize = 1;
#if defined(is_utf8_string) && defined(utf8_to_uvchr)
bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
#endif
const char *pv = str;
const char * const end = pv + count;
octbuf[0] = esc;
if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
sv_setpvs(dsv, "");
#if defined(is_utf8_string) && defined(utf8_to_uvchr)
if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
isuni = 1;
#endif
for (; pv < end && (!max || wrote < max) ; pv += readsize) {
const UV u =
#if defined(is_utf8_string) && defined(utf8_to_uvchr)
isuni ? utf8_to_uvchr((U8*)pv, &readsize) :
#endif
(U8)*pv;
const U8 c = (U8)u & 0xFF;
if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/PageKit.pm view on Meta::CPAN
1;
package Apache2::PageKit;
# $Id: PageKit.pm,v 1.236 2004/05/06 09:54:35 borisz Exp $
# require perl 5.8 for numerous utf8 issues ( and Encode )
require 5.008;
use strict;
# CPAN Modules required for pagekit
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/REST/Writer/json.pm view on Meta::CPAN
my ($self, $resp ) = @_ ;
#Shallow unblessed copy of response
# JSON wont output blessed object not implementing the TO_JSON request
my %resp = %$resp ;
my $coder = JSON::XS->new->allow_blessed(0)->utf8;
## These are bytes. This is correct.
return $coder->encode(\%resp) ;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/SSI.pm view on Meta::CPAN
{
$r->log->error( "HTML data exceeds our size threshold of $max_length. Rejecting the request." );
$r->status( &Apache2::Const::HTTP_REQUEST_ENTITY_TOO_LARGE );
return( &Apache2::Const::OK );
}
my $html = $u->slurp_utf8;
if( !length( $html ) )
{
$r->status( &Apache2::Const::HTTP_NO_CONTENT );
return( &Apache2::Const::OK );
}
lib/Apache2/SSI.pm view on Meta::CPAN
{
local $@;
# try-catch
$res = eval
{
Encode::encode( 'utf8', $res, Encode::FB_CROAK );
};
if( $@ )
{
$r->log->error( "${class} encountered an error while trying to encode data into utf8: $@" );
return( &Apache2::Const::DECLINED );
}
my $len = length( $res );
# try-catch
lib/Apache2/SSI.pm view on Meta::CPAN
local $@;
# try-catch
$html = eval
{
Encode::decode( 'utf8', $html, Encode::FB_CROAK );
};
if( $@ )
{
$r->log->error( "${class} [PerlOutputFilterHandler]: Failed to decode data from utf8: $@" );
return( &Apache2::Const::DECLINED );
}
#W We just add that the charset is utf-8
$main->content_type( 'text/html; charset=utf-8' ) unless( $main->content_type =~ /\bcharset\n/i );
lib/Apache2/SSI.pm view on Meta::CPAN
else
{
# try-catch
$res = eval
{
Encode::encode( 'utf8', $res, Encode::FB_CROAK );
};
if( $@ )
{
$r->log->error( "${class} [PerlOutputFilterHandler]: encountered an error while trying to encode data into utf8: $@" );
return( &Apache2::Const::DECLINED );
}
# $r->headers_out->unset( 'Content-Length' );
my $len = length( $res );
lib/Apache2/SSI.pm view on Meta::CPAN
else
{
require MIME::Base64;
$v = MIME::Base64::decode( $v );
}
$v = Encode::decode( 'utf8', $v ) if( $self->_has_utf8( $v ) );
return( $v );
};
if( $@ )
{
return( $self->error( "Error while decoding base64 data: $@" ) );
lib/Apache2/SSI.pm view on Meta::CPAN
# try-catch
my $rv = eval
{
if( $self->mod_perl )
{
return( Encode::decode( 'utf8', APR::Request::decode( @_ ), Encode::FB_CROAK ) );
}
else
{
# Will use XS version automatically
require URL::Encode;
return( URL::Encode::url_decode_utf8( @_ ) );
}
};
if( $@ )
{
return( $self->error( "Error while url decoding data: $@" ) );
lib/Apache2/SSI.pm view on Meta::CPAN
local $@;
# try-catch
my $rv = eval
{
my $v = join( '', @_ );
$v = Encode::encode( 'utf8', $v, Encode::FB_CROAK ) if( Encode::is_utf8( $v ) );
if( $self->mod_perl )
{
return( APR::Base64::encode( $v ) );
}
else
lib/Apache2/SSI.pm view on Meta::CPAN
# try-catch
my $rv = eval
{
require Digest::MD5;
my $v = join( '', @_ );
$v = Encode::encode( 'utf8', $v, Encode::FB_CROAK ) if( Encode::is_utf8( $v ) );
return( Digest::MD5::md5_hex( $v ) );
};
if( $@ )
{
return( $self->error( "Error while encoding data into md5 hex: $@" ) );
lib/Apache2/SSI.pm view on Meta::CPAN
local $@;
# try-catch
my $rv = eval
{
require URI::Escape::XS;
# return( URI::Escape::uri_escape_utf8( join( '', @_ ) ) );
return( URI::Escape::XS::uri_escape( join( '', @_ ) ) );
};
if( $@ )
{
return( $self->error( "Error while encoding uri: $@" ) );
lib/Apache2/SSI.pm view on Meta::CPAN
# try-catch
my $rv = eval
{
if( $self->mod_perl )
{
my $v = Encode::encode( 'utf8', join( '', @_ ), Encode::FB_CROAK );
return( APR::Request::encode( $v ) );
}
else
{
# Will use XS version automatically
require URL::Encode;
return( URL::Encode::url_encode_utf8( join( '', @_ ) ) );
}
};
if( $@ )
{
return( $self->error( "Error while url encoding data: $@" ) );
lib/Apache2/SSI.pm view on Meta::CPAN
if( !-e( "$filename" ) )
{
return( $self->errmsg );
}
# TODO This needs to be improved, as we should not assume the file encoding is utf8
# It could be binary or some other text encoding like iso-2022-jp
# So we should slurp it, parse the meta tags if this is an html and decode if the charset attribute is set or default to utf8
# But this complicates things quite a bit, so for now, it is just utf8 simply
my $html = $f->slurp_utf8;
if( !defined( $html ) )
{
$self->error( "Unable to get html data of included file \"", $f->filename, "\": ", $f->error );
return( $self->errmsg );
}
lib/Apache2/SSI.pm view on Meta::CPAN
$self->{suspend}->[0] = !( $self->{if_state}->[0] = !!$cond );
}
return( '' );
}
sub _has_utf8
{
my $self = shift( @_ );
return( $_[0] =~ /$IS_UTF8/ );
}
lib/Apache2/SSI.pm view on Meta::CPAN
# Default error message to display when ssi failed to parse
# Default to [an error occurred while processing this directive]
errmsg => '[Oops]'
);
my $fh = IO::File->new( "</some/file.html" ) || die( "$!\n" );
$fh->binmode( ':utf8' );
my $size = -s( $fh );
my $html;
$fh->read( $html, $size );
$fh->close;
if( !defined( my $result = $ssi->parse( $html ) ) )
lib/Apache2/SSI.pm view on Meta::CPAN
=head2 decode_base64
Decode base64 data provided. When running under Apache mod_perl, this uses L<APR::Base64/decode> module, otherwise it uses L<MIME::Base64/decode>
If the decoded data contain utf8 data, this will decode the utf8 data using L<Encode/decode>
If an error occurred during decoding, it will return undef and set an L</error> object accordingly.
=head2 decode_entities
lib/Apache2/SSI.pm view on Meta::CPAN
$ssi->decode_uri( 'https%3A%2F%2Fwww.example.com%2F' );
# https://www.example.com/
=head2 decode_url
Decode x-www-form-urlencoded encoded data. When using Apache mod_perl, this uses L<APR::Request/decode> and L<Encode/decode>, otherwise it uses L<URL::Encode/url_decode_utf8> (its XS version) to achieve the same result.
If an error occurred during decoding, it will return undef and set an L</error> object accordingly.
Example:
lib/Apache2/SSI.pm view on Meta::CPAN
=head2 encode_base64
Encode data provided into base64. When running under Apache mod_perl, this uses L<APR::Base64/encode> module, otherwise it uses L<MIME::Base64/encode>
If the data have the perl internal utf8 flag on as checked with L<Encode/is_utf8>, this will encode the data into utf8 using L<Encode/encode> before encoding it into base64.
Please note that the base64 encoded resulting data is all on one line, similar to what Apache would do. The data is B<NOT> broken into lines of 76 characters.
If an error occurred during encoding, it will return undef and set an L</error> object accordingly.
lib/Apache2/SSI.pm view on Meta::CPAN
$ssi->encode_uri( 'https://www.example.com/' );
# https%3A%2F%2Fwww.example.com%2F
=head2 encode_url
Encode data provided into an x-www-form-urlencoded string. When using Apache mod_perl, this uses L<APR::Request/encode>, otherwise it uses L<URL::Encode/url_encode_utf8> (its XS version)
If an error occurred during decoding, it will return undef and set an L</error> object accordingly.
Example:
lib/Apache2/SSI.pm view on Meta::CPAN
=head2 parse_func_base64
Returns the arguments provided into a base64 string.
If the arguments are utf8 data with perl internal flag on, as checked with L<Encode/is_utf8>, this will encode the data into utf8 with L<Encode/encode> before encoding it into base64.
Example:
<!--#set var="payload" value='{"sub":"1234567890","name":"John Doe","iat":1609047546}' encoding="base64" -->
<!--#if expr="$payload == 'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNjA5MDQ3NTQ2fQo='" -->
lib/Apache2/SSI.pm view on Meta::CPAN
=head2 parse_func_md5
Hash the string using MD5, then encode the hash with hexadecimal encoding.
If the arguments are utf8 data with perl internal flag on, as checked with L<Encode/is_utf8>, this will encode the data into utf8 with L<Encode/encode> before encoding it with md5.
Example:
<!--#if expr="md5( $hash_data ) == '2f50e645b6ef04b5cfb76aed6de343eb'" -->
You're good to go.
lib/Apache2/SSI.pm view on Meta::CPAN
It will try to resolve the file to include by calling L</find_file> with the same arguments this is called with.
Under Apache, if the previous look up succeeded, it calls L<Apache2::SubRequest/run>
Outside of Apache, it reads the entire file, utf8 decode it and return it.
=head2 parse_perl
Provided with an hash reference of parameters and this parse some perl command and returns the output as a string.
lib/Apache2/SSI.pm view on Meta::CPAN
Sets or gets the formatting for date and time values. The format takes the same values as L<POSIX/strftime>
=head1 Encoding
At present time, the html data are treated as utf8 data and decoded and encoded back as such.
If there is a need to broaden support for other charsets, let me know.
=head1 SSI Directives
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/ScoreBoardFile.pm view on Meta::CPAN
XSLoader::load('Apache2::ScoreBoardFile', $VERSION);
1;
__END__
=encoding utf8
=head1 NAME
Apache2::ScoreBoardFile - Perl extension to the Apache HTTPD ScoreBoard
view all matches for this distribution
view release on metacpan or search on metacpan
script/diffprov view on Meta::CPAN
my $l=$_;
local $_;
map {
ref $_
? [
Encode::decode('utf8', $_->[0]), # key
Encode::decode('utf8', $_->[1]), # uri
$_->[2], # block
$_->[3], # order
Encode::decode('utf8', $_->[4]), # action
Encode::decode('utf8', $_->[5]), # note
]
: ''
} @{$l}[1,2];
}]} @diff]);
exit 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/WebApp/Plugin/Mail.pm view on Meta::CPAN
my $msg = MIME::Lite::TT::HTML->new(
From => $data_ref->{from} || $c->config->{project_email},
To => $data_ref->{to},
Subject => $data_ref->{subject},
Encoding => 'quoted-printable',
Charset => 'utf8',
Template => {
html => $data_ref->{template}->{file}->{html},
text => $data_ref->{template}->{file}->{txt},
},
TmplParams => $data_ref->{template}->{vars},
view all matches for this distribution