Result:
found more than 540 distributions - search limited to the first 2001 files matching your query ( run in 1.038 )


AnySan-Provider-Slack

 view release on metacpan or  search on metacpan

lib/AnySan/Provider/Slack.pm  view on Meta::CPAN

            return unless grep { $_ eq 'all' || $_ eq $message->{subtype} } @$filter;
        }

        # search user nickname
        my $nickname = '';
        my $user_id = encode_utf8($message->{user} || '');
        my $user = $self->user($user_id);
        my $bot = $self->bot($user_id);
        $nickname = $user->{name} if $user;
        $nickname = $bot->{name} if $bot;

        my $receive; $receive = AnySan::Receive->new(
            provider      => 'slack',
            event         => 'message',
            message       => encode_utf8($message->{text} || ''),
            nickname      => encode_utf8($metadata->{self}{name} || ''),
            from_nickname => $nickname,
            attribute     => {
                channel => $message->{channel},
                subtype => $message->{subtype},
                user    => $user,

lib/AnySan/Provider/Slack.pm  view on Meta::CPAN

    my $req = POST "https://slack.com/api/$method", [
        token   => $self->{config}{token},
        @$params,
    ];
    my %headers = map { $_ => $req->header($_), } $req->headers->header_field_names;
    my $jd = $self->{json_driver} ||= JSON->new->utf8;
    my $r;
    $r = http_post $req->uri, $req->content, headers => \%headers, sub {
        my $body = shift;
        my $res = $jd->decode($body);
        $cb->($res);

 view all matches for this distribution


AnySan

 view release on metacpan or  search on metacpan

eg/friend_feed.pl  view on Meta::CPAN

#!/usr/bin/env perl
use strict;
use warnings;
use lib 'lib';
use utf8;

use AnySan;
use AnySan::Provider::FriendFeed;

my $request = $ARGV[0] || '/feed/cpan';

 view all matches for this distribution


Aozora2Epub

 view release on metacpan or  search on metacpan

lib/Aozora2Epub.pm  view on Meta::CPAN

package Aozora2Epub;
use utf8;
use strict;
use warnings;
use Aozora2Epub::Gensym;
use Aozora2Epub::CachedGet qw/http_get/;
use Aozora2Epub::Epub;

lib/Aozora2Epub.pm  view on Meta::CPAN


    if ($url_or_path =~ m{^https?://}) {
        return http_get($url_or_path);
    }
    if ($url_or_path =~ m{\.html$}) {
        return path($url_or_path)->slurp_utf8;
    }
    return path($url_or_path)->slurp_raw;
}

sub _get_content {

 view all matches for this distribution


AozoraBunko-Checkerkun

 view release on metacpan or  search on metacpan

author/bench.pl  view on Meta::CPAN

#!/usr/bin/env perl

use strict;
use warnings;
use utf8;
use Encode    qw//;
use Benchmark qw/cmpthese/;

my $ENC  = Encode::find_encoding("Shift_JIS");
my $char = '💓';

 view all matches for this distribution


Apache-ACEProxy

 view release on metacpan or  search on metacpan

lib/Apache/ACEProxy.pm  view on Meta::CPAN


  package Apache::ACEProxy::UTF8_RACE;

  use base qw(Apache::ACEProxy);
  use Convert::RACE qw(to_race);
  use Unicode::String qw(utf8);

  sub encode {
      my($class, $domain) = @_;
      return to_race(utf8($domain)->utf16);
  }

Note that you should define C<encode()> method as a class
method. Argument $domain is a (maybe UTF8) string that your browser
sends to the proxy server.

 view all matches for this distribution


Apache-ASP

 view release on metacpan or  search on metacpan

lib/Apache/ASP/Response.pm  view on Meta::CPAN

    }

    # add dataref to buffer
    ${$self->{out}} .= $$dataref;
    
    #Encode::_utf8_on(${$self->{out}});
    
	#Encode::from_to(${$self->{out}}, "utf8", "iso-8859-1");
	
    # do we flush now?  not if we are buffering
    if(! $self->{'Buffer'} && ! $self->{'FormFill'}) {
	# we test for whether anything is in the buffer since
	# this way we can keep reading headers before flushing

 view all matches for this distribution


Apache-AuthCookie

 view release on metacpan or  search on metacpan

t/lib/Sample/Apache/AuthCookieHandler.pm  view on Meta::CPAN

package Sample::Apache::AuthCookieHandler;

use strict;
use utf8;
use base 'Apache::AuthCookie';
use Apache;
use Apache::Constants qw(:common);
use Apache::AuthCookie;
use Apache::Util;
use URI::Escape qw(uri_escape_utf8 uri_unescape);
use Encode;

sub authen_cred ($$\@) {
    my $self = shift;
    my $r = shift;

t/lib/Sample/Apache/AuthCookieHandler.pm  view on Meta::CPAN


    # This would really authenticate the credentials 
    # and return the session key.
    # Here I'm just using setting the session
    # key to the escaped credentials and delaying authentication.
    return join ':', map { uri_escape_utf8($_) } @creds;
}

sub authen_ses_key ($$$) {
    my ($self, $r, $ses_key) = @_;

    # NOTE: uri_escape_utf8() was used to encode this so we have to decode
    # using UTF-8.  We don't rely on $self->encoding($r) here because if an
    # encoding other than UTF-8 is configured in t/conf/extra.conf.in, then the
    # wrong encoding gets used here.
    my($user, $password) =
        map { decode('UTF-8', uri_unescape($_)) }

 view all matches for this distribution


Apache-ConfigParser

 view release on metacpan or  search on metacpan

t/httpd02.answer  view on Meta::CPAN

          reference 1-1-2-123-2-36 Apache::ConfigParser::Directive=HASH key 'mother'
             SEEN reference 1-1-2-122 Apache::ConfigParser::Directive=HASH
          reference 1-1-2-123-2-36 Apache::ConfigParser::Directive=HASH key 'name'
             'addcharset'
          reference 1-1-2-123-2-36 Apache::ConfigParser::Directive=HASH key 'orig_value'
             'UTF-8        .utf8'
          reference 1-1-2-123-2-36 Apache::ConfigParser::Directive=HASH key 'orig_value_array'
            reference 1-1-2-123-2-37-2 ARRAY with 2 elements
            reference 1-1-2-123-2-37-2 ARRAY index 0
               'UTF-8'
            reference 1-1-2-123-2-37-2 ARRAY index 1
               '.utf8'
          reference 1-1-2-123-2-36 Apache::ConfigParser::Directive=HASH key 'value'
             'UTF-8 .utf8'
          reference 1-1-2-123-2-36 Apache::ConfigParser::Directive=HASH key 'value_array'
            reference 1-1-2-123-2-37-3 ARRAY with 2 elements
            reference 1-1-2-123-2-37-3 ARRAY index 0
               'UTF-8'
            reference 1-1-2-123-2-37-3 ARRAY index 1
               '.utf8'
        reference 1-1-2-123-1 ARRAY index 37
          reference 1-1-2-123-2-37 Apache::ConfigParser::Directive=HASH with 10 keys
          reference 1-1-2-123-2-37 Apache::ConfigParser::Directive=HASH key 'attributes'
            reference 1-1-2-123-2-38-0 HASH with 0 keys
          reference 1-1-2-123-2-37 Apache::ConfigParser::Directive=HASH key 'daughters'

 view all matches for this distribution


Apache-Filter-HanConvert

 view release on metacpan or  search on metacpan

HanConvert.pm  view on Meta::CPAN

documents.

From the settings in L</SYNOPSIS>, the server would negotiate with the
client's browser about their C<Accept-Language> preference (C<zh-cn> and
C<zh> means Simplified, other C<zh-*> means Traditional), as well as the
preferred C<Accept-Charset> setting (defaults to C<utf8> if nothing
was explicitly specified).

The C<Content-Type> header will be rewritten to reflect the final
encoding used.

HanConvert.pm  view on Meta::CPAN


	$to_encoding = $1
	    if $chars =~ /\b($charsets{$to_variant})\b/i;
    }

    my $var_enc	   = $variants{"$from_variant$to_variant"} || 'utf8';
    $from_encoding = Encode::resolve_alias($from_encoding) || 'utf8';
    $to_encoding   = Encode::resolve_alias($to_encoding)   || 'utf8';

    return Apache::DECLINED if $from_encoding eq $to_encoding
			    and $from_variant eq $to_variant;

    my $charset = ($to_encoding eq 'utf8' ? 'utf-8' : $to_encoding);
    $content_type =~ s/(?:;charset=[^;]+(.*))?$/;charset=$charset$1/;
    $r->content_type($content_type);

    my $c = $filter->c;
    my $bb_ctx = APR::Brigade->new($c->pool, $c->bucket_alloc);

HanConvert.pm  view on Meta::CPAN


	my $buffer;
	my $status = $bucket->read($buffer);
	return $status unless $status == APR::SUCCESS;

	Encode::from_to($buffer, $from_encoding => 'utf8', Encode::FB_HTMLCREF)
	    if $from_encoding ne 'utf8';

	if ($var_enc eq $to_encoding) {
	    $bucket = APR::Bucket->new( $buffer );
	}
	elsif ($data .= $buffer) {

 view all matches for this distribution


Apache-Gallery

 view release on metacpan or  search on metacpan

lib/Apache/Gallery.pm  view on Meta::CPAN

			my $comment_ref = get_comment($path . '/' . $picfilename . '.comment');
			$foundcomment = 1;
			$tpl_vars{COMMENT} = $comment_ref->{COMMENT} . '<br />' if $comment_ref->{COMMENT};
			$tpl_vars{TITLE} = $comment_ref->{TITLE} if $comment_ref->{TITLE};
		} elsif ($r->dir_config('GalleryCommentExifKey')) {
			my $comment = decode("utf8", $imageinfo->{$r->dir_config('GalleryCommentExifKey')});
			$tpl_vars{COMMENT} = encode("iso-8859-1", $comment);
		} else {
			$tpl_vars{COMMENT} = '';
		}

 view all matches for this distribution


Apache-GzipChain

 view release on metacpan or  search on metacpan

lib/Apache/GzipChain.pm  view on Meta::CPAN

  my $self = shift;
  my $res = join "", @_;
  return unless length($res);
  # srezic in RT 28732: Maybe it would also be appropriate to issue
  # a warning a la "wide character in PRINT", because I consider it
  # an error to have utf8-flagged characters in this stage.
  $self->Apache::OutputChain::PRINT(Compress::Zlib::memGzip($res));
}

1;

lib/Apache/GzipChain.pm  view on Meta::CPAN


To use this module under perl-5.8 or higher with Unicode data you have
to convert to octets before printing them. Something like this will
do:

  Encode::encode_utf8($res);

=head1 PREREQUISITES

Compress::Zlib, Apache::OutputChain

 view all matches for this distribution


Apache-HeavyCGI

 view release on metacpan or  search on metacpan

lib/Apache/HeavyCGI.pm  view on Meta::CPAN

  my $acce = $self->{R}->header_in("Accept") || "";
  return $self->{CAN_PNG} = 0 unless $acce;
  $self->{CAN_PNG} = $acce =~ m|image/png|i;
}

sub can_utf8 {
  my Apache::HeavyCGI $self = shift;
  return $self->{CAN_UTF8} if defined $self->{CAN_UTF8};

  # From chapter 14.2. HTTP/1.1

lib/Apache/HeavyCGI.pm  view on Meta::CPAN


Set by the can_png method. True if client is able to handle PNG.

=item CAN_UTF8

Set by the can_utf8 method. True if client is able to handle UTF8
endoded data.

=item CGI

An object that handles GET and POST parameters and offers the method

 view all matches for this distribution


Apache-Imager-Resize

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

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_QUAD_MAX|5.004000||p

ppport.h  view on Meta::CPAN

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|||
SvREFCNT|||

ppport.h  view on Meta::CPAN

block_start|||
boolSV|5.004000||p
boot_core_PerlIO|||
boot_core_UNIVERSAL|||
boot_core_xsutils|||
bytes_from_utf8||5.007001|
bytes_to_utf8||5.006001|
cache_re|||
call_argv|5.006000||p
call_atexit||5.006000|
call_body|||
call_list_body|||

ppport.h  view on Meta::CPAN

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|||

ppport.h  view on Meta::CPAN

hv_store_ent||5.004000|
hv_store_flags||5.008000|
hv_store|||
hv_undef|||
ibcmp_locale||5.004000|
ibcmp_utf8||5.007003|
ibcmp|||
incl_perldb|||
incline|||
incpush|||
ingroup|||

ppport.h  view on Meta::CPAN

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||5.006000|
is_utf8_cntrl||5.006000|
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_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|||
keyword|||

ppport.h  view on Meta::CPAN

magic_setpos|||
magic_setregexp|||
magic_setsig|||
magic_setsubstr|||
magic_settaint|||
magic_setutf8|||
magic_setuvar|||
magic_setvec|||
magic_set|||
magic_sizepack|||
magic_wipepack|||

ppport.h  view on Meta::CPAN

sv_2nv|||
sv_2pv_flags||5.007002|
sv_2pv_nolen|5.006000||p
sv_2pvbyte_nolen|||
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|||

ppport.h  view on Meta::CPAN

sv_inc|||
sv_insert|||
sv_isa|||
sv_isobject|||
sv_iv||5.005000|
sv_len_utf8||5.006000|
sv_len|||
sv_magicext||5.007003|
sv_magic|||
sv_mortalcopy|||
sv_newmortal|||

ppport.h  view on Meta::CPAN

sv_pvbyte||5.006000|
sv_pvn_force_flags||5.007002|
sv_pvn_force|||p
sv_pvn_nomg|5.007003||p
sv_pvn|5.006000||p
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_release_IVX|||
sv_replace|||
sv_report_used|||

ppport.h  view on Meta::CPAN

sv_unref|||
sv_untaint||5.004000|
sv_upgrade|||
sv_usepvn_mg|5.006000||p
sv_usepvn|||
sv_utf8_decode||5.006000|
sv_utf8_downgrade||5.006000|
sv_utf8_encode||5.006000|
sv_utf8_upgrade_flags||5.007002|
sv_utf8_upgrade||5.007001|
sv_uv|5.006000||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

ppport.h  view on Meta::CPAN

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|
tokeq|||
tokereport|||
too_few_arguments|||
too_many_arguments|||
unlnk|||

ppport.h  view on Meta::CPAN

unshare_hek|||
unsharepvn||5.004000|
upg_version||5.009000|
usage|||
utf16_textfilter|||
utf16_to_utf8_reversed||5.006001|
utf16_to_utf8||5.006001|
utf16rev_textfilter|||
utf8_distance||5.006000|
utf8_hop||5.006000|
utf8_length||5.007001|
utf8_mg_pos_init|||
utf8_mg_pos|||
utf8_to_bytes||5.006001|
utf8_to_uvchr||5.007001|
utf8_to_uvuni||5.007001|
utf8n_to_uvchr||5.007001|
utf8n_to_uvuni||5.007001|
utilize|||
uvchr_to_utf8_flags||5.007003|
uvchr_to_utf8||5.007001|
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
validate_suid|||
vcall_body|||
vcall_list_body|||
vcmp||5.009000|
vcroak||5.006000|

ppport.h  view on Meta::CPAN

#if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)

char *
DPPP_(my_sv_2pvbyte)(pTHX_ register SV *sv, STRLEN *lp)
{   
  sv_utf8_downgrade(sv,0);
  return SvPV(sv,*lp);
}

#endif

ppport.h  view on Meta::CPAN


#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

 view all matches for this distribution


Apache-LoadAvgLimit

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN


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


Apache-Log-Parser

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN


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


Apache-LogFormat-Compiler

 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


Apache-LoggedAuthDBI

 view release on metacpan or  search on metacpan

DBI.pm  view on Meta::CPAN

		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 {

DBI.pm  view on Meta::CPAN



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 {

DBI.pm  view on Meta::CPAN


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


Apache-PageKit

 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


Apache-RSS

 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


Apache-Request-I18N

 view release on metacpan or  search on metacpan

I18N.pm  view on Meta::CPAN

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';

I18N.pm  view on Meta::CPAN

	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;

I18N.pm  view on Meta::CPAN



# 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


Apache-SWIT

 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


Apache-SecSess

 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


Apache-Session-Browseable

 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


Apache-Session-MongoDB

 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


Apache-Solr

 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};
	}
	elsif($fn)

 view all matches for this distribution


Apache-Test

 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


Apache-Tika

 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


Apache-WebDAV

 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


Apache-Wyrd

 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


Apache2-API

 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( $rv );
}

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

    # Guardrails on inputs
    if( !defined( $code ) || $code !~ /^[0-9]{3}$/ )
    {
        $resp->code( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
        $resp->rflush;
        $resp->print( $self->json->utf8->encode({ error => 'An unexpected server error occured', code => 500 }) );
        $self->error( "http code to be used '", ( $code // 'undef' ), "' is invalid. It should be only integers." );
        return( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
    }
    if( ref( $ref ) ne 'HASH' )
    {
        $resp->code( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
        $resp->rflush;
        # $r->send_http_header;
        $resp->print( $self->json->utf8->encode({ error => 'An unexpected server error occured', code => 500 }) );
        $self->error( "Data provided to send is not a hash ref." );
        return( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
    }

    # Resolve whether this is an error

lib/Apache2/API.pm  view on Meta::CPAN

        # See <https://perl.apache.org/docs/2.0/user/handlers/http.html#PerlCleanupHandler>
        $r->pool->cleanup_register( $cleanup, $self );
    }

    # 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
    if( !$self->print( $json ) )
    {
        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


( run in 1.038 second using v1.01-cache-2.11-cpan-39bf76dae61 )