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


CBOR-Free

 view release on metacpan or  search on metacpan

lib/CBOR/Free.pm  view on Meta::CPAN

This is probably what you want if you
follow the receive-decode-process-encode-output workflow that
L<perlunitut> recommends (which you might be doing via C<use utf8>)
B<AND> if you intend for your CBOR to contain exclusively text.

Think of this option as: “All my strings are decoded.”

(Perl internals note: if !SvUTF8, the CBOR will be the UTF8-upgraded
version.)

=item * C<as_text>: Treats all strings as octets of UTF-8.

lib/CBOR/Free.pm  view on Meta::CPAN


Notes on mapping CBOR to Perl:

=over

=item * C<decode()> decodes CBOR text strings as UTF-8-decoded Perl strings.
CBOR binary strings become undecoded Perl strings.

(See L<CBOR::Free::Decoder> and L<CBOR::Free::SequenceDecoder> for more
character-decoding options.)

Notes:

lib/CBOR/Free.pm  view on Meta::CPAN

L<CBOR::Free::Decoder> and L<CBOR::Free::SequenceDecoder> if you want
to tolerate invalid UTF-8.)

=item * You can reliably use C<utf8::is_utf8()> to determine if a given Perl
string came from CBOR text or binary, but B<ONLY> if you test the scalar as
it appears in the newly-decoded data structure itself. Generally Perl code
should avoid C<is_utf8()>, but with CBOR::Free-created strings this limited
use case is legitimate and potentially gainful.

=back

 view all matches for this distribution


CBOR-PP

 view release on metacpan or  search on metacpan

lib/CBOR/PP/Decode.pm  view on Meta::CPAN

=over

=item * All tags are ignored. (This could be iterated on later.)

=item * Indefinite-length objects are supported, but streamed parsing
is not; the data structure must be complete to be decoded.

=item * CBOR text strings are decoded to UTF8-flagged strings, while
binary strings are decoded to non-UTF8-flagged strings. In practical
terms, this means that a decoded CBOR binary string will have no code point
above 255, while a decoded CBOR text string can contain any valid Unicode
code point.

=item * null, undefined, true, and false become undef, undef,
Types::Serialiser::true(), and Types::Serialiser::false(), respectively.
(NB: undefined is deserialized as an error object in L<CBOR::XS>,

 view all matches for this distribution


CBOR-XS

 view release on metacpan or  search on metacpan

XS.pm  view on Meta::CPAN

 # prefix decoding

 my $many_cbor_strings = ...;
 while (length $many_cbor_strings) {
    my ($data, $length) = $cbor->decode_prefix ($many_cbor_strings);
    # data was decoded
    substr $many_cbor_strings, 0, $length, ""; # remove decoded cbor string
 }

=head1 DESCRIPTION

This module converts Perl data structures to the Concise Binary Object

XS.pm  view on Meta::CPAN

reference to the earlier value.

This means that such values will only be encoded once, and will not result
in a deep cloning of the value on decode, in decoders supporting the value
sharing extension. This also makes it possible to encode cyclic data
structures (which need C<allow_cycles> to be enabled to be decoded by this
module).

It is recommended to leave it off unless you know your
communication partner supports the value sharing extensions to CBOR
(L<http://cbor.schmorp.de/value-sharing>), as without decoder support, the

XS.pm  view on Meta::CPAN

If C<$enable> is false (the default), then C<encode> will encode shared
data structures repeatedly, unsharing them in the process. Cyclic data
structures cannot be encoded in this mode.

This option does not affect C<decode> in any way - shared values and
references will always be decoded properly if present.

=item $cbor = $cbor->allow_cycles ([$enable])

=item $enabled = $cbor->get_allow_cycles

If C<$enable> is true (or missing), then C<decode> will happily decode
self-referential (cyclic) data structures. By default these will not be
decoded, as they need manual cleanup to avoid memory leaks, so code that
isn't prepared for this will not leak memory.

If C<$enable> is false (the default), then C<decode> will throw an error
when it encounters a self-referential/cyclic data structure.

XS.pm  view on Meta::CPAN


If C<$enable> is false (the default), then C<encode> will encode strings
the standard CBOR way.

This option does not affect C<decode> in any way - string references will
always be decoded properly if present.

=item $cbor = $cbor->text_keys ([$enable])

=item $enabled = $cbor->get_text_keys

XS.pm  view on Meta::CPAN


Sets or replaces the tagged value decoding filter (when C<$cb> is
specified) or clears the filter (if no argument or C<undef> is provided).

The filter callback is called only during decoding, when a non-enforced
tagged value has been decoded (see L<TAG HANDLING AND EXTENSIONS> for a
list of enforced tags). For specific tags, it's often better to provide a
default converter using the C<%CBOR::XS::FILTER> hash (see below).

The first argument is the numerical tag, the second is the (decoded) value
that has been tagged.

The filter function should return either exactly one value, which will
replace the tagged value in the decoded data structure, or no values,
which will result in default handling, which currently means the decoder
creates a C<CBOR::XS::Tagged> object to hold the tag and the value.

When the filter is cleared (the default state), the default filter
function, C<CBOR::XS::default_filter>, is used. This function simply

XS.pm  view on Meta::CPAN


The following methods help with this:

=over 4

=item @decoded = $cbor->incr_parse ($buffer)

This method attempts to decode exactly one CBOR value from the beginning
of the given C<$buffer>. The value is removed from the C<$buffer> on
success. When C<$buffer> doesn't contain a complete value yet, it returns
nothing. Finally, when the C<$buffer> doesn't start with something
that could ever be a valid CBOR value, it raises an exception, just as
C<decode> would. In the latter case the decoder state is undefined and
must be reset before being able to parse further.

This method modifies the C<$buffer> in place. When no CBOR value can be
decoded, the decoder stores the current string offset. On the next call,
continues decoding at the place where it stopped before. For this to make
sense, the C<$buffer> must begin with the same octets as on previous
unsuccessful calls.

You can call this method in scalar context, in which case it either
returns a decoded value or C<undef>. This makes it impossible to
distinguish between CBOR null values (which decode to C<undef>) and an
unsuccessful decode, which is often acceptable.

=item @decoded = $cbor->incr_parse_multiple ($buffer)

Same as C<incr_parse>, but attempts to decode as many CBOR values as
possible in one go, instead of at most one. Calls to C<incr_parse> and
C<incr_parse_multiple> can be interleaved.

XS.pm  view on Meta::CPAN

Byte strings will become octet strings in Perl (the Byte values 0..255
will simply become characters of the same value in Perl).

=item UTF-8 strings

UTF-8 strings in CBOR will be decoded, i.e. the UTF-8 octets will be
decoded into proper Unicode code points. At the moment, the validity of
the UTF-8 octets will not be validated - corrupt input will result in
corrupted Perl strings.

=item arrays, maps

XS.pm  view on Meta::CPAN

If an object supports neither C<TO_CBOR> nor C<FREEZE>, encoding will fail
with an error.

=head3 DECODING

Objects encoded via C<TO_CBOR> cannot (normally) be automatically decoded,
but objects encoded via C<FREEZE> can be decoded using the following
protocol:

When an encoded CBOR perl object is encountered by the decoder, it will
look up the C<THAW> method, by using the stored classname, and will fail
if the method cannot be found.

XS.pm  view on Meta::CPAN

CBOR::XS::Tagged object on decoding, and only encoding the tag when
explicitly requested).

Tags not handled specifically are currently converted into a
L<CBOR::XS::Tagged> object, which is simply a blessed array reference
consisting of the numeric tag value followed by the (decoded) CBOR value.

Future versions of this module reserve the right to special case
additional tags (such as base64url).

=head2 ENFORCED TAGS

XS.pm  view on Meta::CPAN


=over 4

=item 26 (perl-object, L<http://cbor.schmorp.de/perl-object>)

These tags are automatically created (and decoded) for serialisable
objects using the C<FREEZE/THAW> methods (the L<Types::Serialier> object
serialisation protocol). See L<OBJECT SERIALISATION> for details.

=item 28, 29 (shareable, sharedref, L<http://cbor.schmorp.de/value-sharing>)

These tags are automatically decoded when encountered (and they do not
result in a cyclic data structure, see C<allow_cycles>), resulting in
shared values in the decoded object. They are only encoded, however, when
C<allow_sharing> is enabled.

Not all shared values can be successfully decoded: values that reference
themselves will I<currently> decode as C<undef> (this is not the same
as a reference pointing to itself, which will be represented as a value
that contains an indirect reference to itself - these will be decoded
properly).

Note that considerably more shared value data structures can be decoded
than will be encoded - currently, only values pointed to by references
will be shared, others will not. While non-reference shared values can be
generated in Perl with some effort, they were considered too unimportant
to be supported in the encoder. The decoder, however, will decode these
values as shared values.

=item 256, 25 (stringref-namespace, stringref, L<http://cbor.schmorp.de/stringref>)

These tags are automatically decoded when encountered. They are only
encoded, however, when C<pack_strings> is enabled.

=item 22098 (indirection, L<http://cbor.schmorp.de/indirection>)

This tag is automatically generated when a reference are encountered (with

XS.pm  view on Meta::CPAN


=over 4

=item 0, 1 (date/time string, seconds since the epoch)

These tags are decoded into L<Time::Piece> objects. The corresponding
C<Time::Piece::TO_CBOR> method always encodes into tag 1 values currently.

The L<Time::Piece> API is generally surprisingly bad, and fractional
seconds are only accidentally kept intact, so watch out. On the plus side,
the module comes with perl since 5.10, which has to count for something.

=item 2, 3 (positive/negative bignum)

These tags are decoded into L<Math::BigInt> objects. The corresponding
C<Math::BigInt::TO_CBOR> method encodes "small" bigints into normal CBOR
integers, and others into positive/negative CBOR bignums.

=item 4, 5, 264, 265 (decimal fraction/bigfloat)

Both decimal fractions and bigfloats are decoded into L<Math::BigFloat>
objects. The corresponding C<Math::BigFloat::TO_CBOR> method I<always>
encodes into a decimal fraction (either tag 4 or 264).

NaN and infinities are not encoded properly, as they cannot be represented
in CBOR.

See L<BIGNUM SECURITY CONSIDERATIONS> for more info.

=item 30 (rational numbers)

These tags are decoded into L<Math::BigRat> objects. The corresponding
C<Math::BigRat::TO_CBOR> method encodes rational numbers with denominator
C<1> via their numerator only, i.e., they become normal integers or
C<bignums>.

See L<BIGNUM SECURITY CONSIDERATIONS> for more info.

XS.pm  view on Meta::CPAN

CBOR implements some extra hints and support for JSON interoperability,
and the spec offers further guidance for conversion between CBOR and
JSON. None of this is currently implemented in CBOR, and the guidelines
in the spec do not result in correct round-tripping of data. If JSON
interoperability is improved in the future, then the goal will be to
ensure that decoded JSON data will round-trip encoding and decoding to
CBOR intact.


=head1 SECURITY CONSIDERATIONS

XS.pm  view on Meta::CPAN


This section contains some random implementation notes. They do not
describe guaranteed behaviour, but merely behaviour as-is implemented
right now.

64 bit integers are only properly decoded when Perl was built with 64 bit
support.

Strings and arrays are encoded with a definite length. Hashes as well,
unless they are tied (or otherwise magical).

XS.pm  view on Meta::CPAN


On perls that were built without 64 bit integer support (these are rare
nowadays, even on 32 bit architectures, as all major Perl distributions
are built with 64 bit integer support), support for any kind of 64 bit
value in CBOR is very limited - most likely, these 64 bit values will
be truncated, corrupted, or otherwise not decoded correctly. This also
includes string, float, array and map sizes that are stored as 64 bit
integers.


=head1 THREADS

 view all matches for this distribution


CDS

 view release on metacpan or  search on metacpan

lib/CDS.pm  view on Meta::CPAN

	my $keyPair = shift; die 'wrong type '.ref($keyPair).' for $keyPair' if defined $keyPair && ref $keyPair ne 'CDS::KeyPair';

	my $response = $o->request('GET', $o->{url}.'/objects/'.$hash->hex, HTTP::Headers->new);
	return if $response->code == 404;
	return undef, 'get ==> HTTP '.$response->status_line if ! $response->is_success;
	return CDS::Object->fromBytes($response->decoded_content(charset => 'none'));
}

sub put {
	my $o = shift;
	my $hash = shift; die 'wrong type '.ref($hash).' for $hash' if defined $hash && ref $hash ne 'CDS::Hash';

lib/CDS.pm  view on Meta::CPAN

	my $headers = HTTP::Headers->new;
	$headers->header('Condensation-Watch' => $timeout.' ms') if $timeout > 0;
	my $needsSignature = $boxLabel ne 'public';
	my $response = $o->request('GET', $boxUrl, $headers, $keyPair, undef, $needsSignature);
	return undef, 'list ==> HTTP '.$response->status_line if ! $response->is_success;
	my $bytes = $response->decoded_content(charset => 'none');

	if (length($bytes) % 32 != 0) {
		print STDERR 'old procotol', "\n";
		my $hashes = [];
		for my $line (split /\n/, $bytes) {

 view all matches for this distribution


CGI-Application-Demo-Ajax

 view release on metacpan or  search on metacpan

lib/CGI/Application/Demo/Ajax.pm  view on Meta::CPAN


=over 4

=item Control passes to search_callback(), the call-back function

=item The data is decoded from JSON to text by a YAHOO.lang.JSON object

=item The data is moved into a YAHOO.util.LocalDataSource object

=item The data is formatted as it's moved into a YAHOO.widget.DataTable object

 view all matches for this distribution


CGI-Application-Plugin-OpenTracing-DataDog

 view release on metacpan or  search on metacpan

t/90_component.t  view on Meta::CPAN


subtest 'Check HTTP UserAgent' => sub {
    
    my @requests = $fake_user_agent->get_all_requests();
    my @structs = map {
        decode_json( $_->decoded_content )
    } @requests;
    my $span_data = $structs[-1];
    cmp_deeply(
        $span_data => [[
            superhashof {

 view all matches for this distribution


CGI-AuthRegister

 view release on metacpan or  search on metacpan

AuthRegister.pm  view on Meta::CPAN

  use HTTP::Request::Common qw(POST);
  my $req = POST $casurl, [ rt=>'verify', username=>$username, stoken=>$stoken ];
  my $resp = $ua->request($req);
  my $result = 'fail';
  if ($resp->is_success) {
    my $message = $resp->decoded_content; $message =~ s/\s//g;
    if ($message eq 'answer:ok') { $result = 'ok'; &_dbg383; }
    else { $Error.=" message=($message);" }
  } else {
    $Error.= "HTTP POST error code: ". $resp->code. "\n".
      "HTTP POST error message: ".$resp->message."\n";

 view all matches for this distribution


CGI-Deurl-XS

 view release on metacpan or  search on metacpan

XS.pm  view on Meta::CPAN

value in the hash is the scalar value of the encoded parameter value. If a
parameter appears more than once, the hash value is an array reference
containing each value given (with value order preserved). Obviously, parameter
order is not preserved in the hash.

HTTP escapes (ASCII and Unicode) are decoded in both keys and values. The utf8
flag is not set on returned strings, nor are non-utf8 encodings decoded.

=back

=head1 EXPORT

 view all matches for this distribution


CGI-Deurl

 view release on metacpan or  search on metacpan

Deurl.pm  view on Meta::CPAN

   $query{a} = 5;
   $query{b} = 13;

=item deurlstr

=item $decodedstring = deurlstr $string

Decodes the string as if it was a CGI parameter value.
That is ist translates all '+' to ' ' and all
%xx to the corresponding character. It doesn't care about
'&' nor '='.

 view all matches for this distribution


CGI-Easy

 view release on metacpan or  search on metacpan

lib/CGI/Easy/Request.pm  view on Meta::CPAN


=item {raw}

By default we suppose request send either in UTF8 (or ASCII) encoding.
Request path, GET/POST/cookie names and values (except uploaded files content)
and uploaded file names will be decoded from UTF8 to Unicode.

If you need to handle requests in other encodings, you should disable
automatic decoding from UTF8 using C<< raw => 1 >> option and decode
all these things manually.

lib/CGI/Easy/Request.pm  view on Meta::CPAN


=item {path}

Path from url, always begin with '/'.

Will be decoded from UTF8 to Unicode unless new() called with option
C<< raw=>1 >>.

=item {GET}

=item {POST}

lib/CGI/Easy/Request.pm  view on Meta::CPAN

        'b[]'   => [ 7, 8 ],
        'c'     => [ 9 ],
    },
    POST => {}

Parameter names and values (except file content) be decoded from UTF8 to
Unicode unless new() called with option C<< raw=>1 >>.

=item {filename}

=item {mimetype}

lib/CGI/Easy/Request.pm  view on Meta::CPAN

    mimetype => {
        a       => undef,
        image   => 'image/gif',
    }

Parameter names and file names will be decoded from UTF8 to Unicode unless
new() called with option C<< raw=>1 >>.

=item {cookie}

Will contain hash with cookie names and values. Example:

lib/CGI/Easy/Request.pm  view on Meta::CPAN

    cookie => {
        some_cookie     => 'some value',
        other_cookie    => 'other value',
    }

Cookie names and values will be decoded from UTF8 to Unicode unless
new() called with option C<< raw=>1 >>.

=item {REMOTE_ADDR}

=item {REMOTE_PORT}

 view all matches for this distribution


CGI-ExtDirect

 view release on metacpan or  search on metacpan

examples/p5httpd  view on Meta::CPAN

PROTECTED:
  logmsg "checking password";
  $passphrase =~ tr#A-Za-z0-9+/##cd;     # remove non-base64 chars
  $passphrase =~ tr#A-Za-z0-9+/# -_#;    # convert to uuencoded format
  my $len = pack( "c", 32 + 0.75 * length($passphrase) );  # compute length byte
  my $decoded = unpack( "u", $len . $passphrase );         # uudecode and print
  my ( $name, $password ) = split /:/, $decoded;

  if ( my $encrypted_password = $encrypted_passwords{$name} ) {
    return $name
      if crypt( $password, $encrypted_password ) eq
      $encrypted_password;                                 # check password

 view all matches for this distribution


CGI-Github-Webhook

 view release on metacpan or  search on metacpan

lib/CGI/Github/Webhook.pm  view on Meta::CPAN

The payload as passed as payload in the POST request if it is valid
JSON, else an error message in JSON format.

=head4 payload_perl

The payload as perl data structure (hashref) as decoded by
decode_json. If the payload was no valid JSON, it returns a hashref
containing either { payload => 'none' } if there was no payload, or {
error => ... } in case of a decode_json error had been caught.

=head1 SUBROUTINES/METHODS

 view all matches for this distribution


CGI-IDS

 view release on metacpan or  search on metacpan

lib/CGI/IDS.pm  view on Meta::CPAN

# DESCRIPTION
#   Equivalent to PHP's urldecode
# INPUT
#   string  the URL to decode
# OUTPUT
#   string  the decoded URL
# SYNOPSIS
#   IDS::urldecode($url);
#****

sub urldecode {

lib/CGI/IDS.pm  view on Meta::CPAN

If the parameter value matches this rule or the rule tag is not present, the IDS will not run its filters on it.
Case-sensitive; mode modifiers I<m> and I<s> in use.

=item * encoding

Use value I<json> if the parameter contains JSON encoded data. IDS will test the decoded data,
otherwise a false positive would occur due to the 'suspicious' JSON encoding characters.

=item * conditions

Set of conditions to be fulfilled. This is the parameter environment in which

 view all matches for this distribution


CGI-Info

 view release on metacpan or  search on metacpan

bin/testjson.pl  view on Meta::CPAN

$req->header('content-type' => 'application/json');
$req->content('{ "first": "Nigel", "last": "Horne" }');

my $resp = $ua->request($req);
if($resp->is_success()) {
	print "Reply:\n\t", $resp->decoded_content, "\n";
} else {
	print STDERR $resp->code(), "\n", $resp->message(), "\n";
}

 view all matches for this distribution


CGI-Lite

 view release on metacpan or  search on metacpan

lib/CGI/Lite.pm  view on Meta::CPAN

=head2 parse_form_data

This handles the following types of requests: GET, HEAD and POST.
By default, CGI::Lite uses the environment variable REQUEST_METHOD to 
determine the manner in which the query/form information should be 
decoded. However, it may also be passed a valid request 
method as a scalar string to force CGI::Lite to decode the information in 
a specific manner. 

	my $params = $cgi->parse_form_data ('GET');

lib/CGI/Lite.pm  view on Meta::CPAN


=head2 url_decode

This method is used to URL-decode a string. 

    $decoded_string = $cgi->url_decode ($string);

Returns the URL-decoded string.

=head2 is_dangerous

This method checks for the existence of dangerous meta-characters.

 view all matches for this distribution


CGI-Minimal

 view release on metacpan or  search on metacpan

lib/CGI/Minimal.pod  view on Meta::CPAN

=over 4

=item url_decode($string);

Returns URL *decoding* of input string (%xx and %uxxxx substitutions
are decoded to their actual values).

Example:

 my $url_decoded_string = $cgi->url_decode($string);

=back

=cut

 view all matches for this distribution


CGI-MxScreen

 view release on metacpan or  search on metacpan

MxScreen/Session/Medium/Browser.pm  view on Meta::CPAN


	require MIME::Base64;
	require Crypt::CBC;
	require Digest::MD5;

	my $decoded = MIME::Base64::decode(CGI::param(MX_CONTEXT));
	my $cipher = new Crypt::CBC($self->key, CRYPT_ALGO);
	my $decrypted = $cipher->decrypt($decoded);
	CGI::delete(MX_CONTEXT);

	#
	# Before attempting to de-serialize, check the MD5 certificate.
	# Deserialization would fail anyway if the context was "corrupted".

 view all matches for this distribution


CGI-PathInfo

 view release on metacpan or  search on metacpan

lib/CGI/PathInfo.pod  view on Meta::CPAN

=over 4

=item url_decode($string);

Returns URL *decoding* of input string (%xx substitutions
are decoded to their actual values).

Example:

 my $url_decoded_string = $path_info->url_decode($string);

=back

=head1 BUGS

 view all matches for this distribution


CGI-Pure

 view release on metacpan or  search on metacpan

Pure.pm  view on Meta::CPAN


		# Value processing.
		my $value;
		if ($self->{'utf8'}) {
			if (ref $pairs_hr->{$key} eq 'ARRAY') {
				my @decoded = ();
				foreach my $val (@{$pairs_hr->{$key}}) {
					push @decoded, decode_utf8($val);
				}
				$value = \@decoded;
			} else {
				$value = decode_utf8($pairs_hr->{$key});
			}
		} else {
			$value = $pairs_hr->{$key};

 view all matches for this distribution


CGI-SecureState

 view release on metacpan or  search on metacpan

SecureState.pm  view on Meta::CPAN


sub decipher
{
    my $self = shift;
    my ($cipher,$statefile) = @$self{'.cipher','.statefile'};
    my ($length,$extra,$decoded,$buffer,$block);

    if ($AVOID_SYMLINKS) { -l $statefile and $self->errormsg('symlink encountered')}
    sysopen(STATEFILE,$statefile, O_RDONLY) || $self->errormsg('failed to open the state file');
    if ($USE_FLOCK) { flock(STATEFILE, LOCK_SH) || $self->errormsg('failed to lock the state file') }
    binmode STATEFILE;

SecureState.pm  view on Meta::CPAN

	#parse metadata
	$block^=$buffer;
	$self->{'.age'} = unpack("N",substr($block,4,4));
	$length = unpack("N",substr($block,0,4));
	$extra = ($length % 8) ? (8-($length % 8)) : 0;
	$decoded=-8;

	#sanity check
	if ((stat(STATEFILE))[7] != ($length+$extra+8))
	{ $self->errormsg('invalid state file') }

SecureState.pm  view on Meta::CPAN

	{ $self->errormsg('invalid state file') }

	my $next_block;
	$block = $cipher->decrypt(substr($buffer,0,8));
	#decrypt it
	while (($decoded+=8)<$length-8) {
	    $next_block = substr($buffer,$decoded+8,8);
	    $block^=$next_block;
	    substr($buffer, $decoded, 8, $block);
	    $block=$cipher->decrypt($next_block);
	}
	substr($buffer, $decoded, 8, $block);
	substr($buffer, -$extra, $extra, "");

    }
    if ($USE_FLOCK) { flock(STATEFILE, LOCK_UN) || $self->errormsg('failed to unlock the state file') }
    close(STATEFILE) || $self->errormsg('failed to close the state file');

 view all matches for this distribution


CGI-Simple

 view release on metacpan or  search on metacpan

lib/CGI/Simple.pm  view on Meta::CPAN


    # short and sweet upload
    $ok = $q->upload( $q->param('upload_file'), '/path/to/write/file.name' );
    print "Uploaded ".$q->param('upload_file')." and wrote it OK!" if $ok;

    $decoded    = $q->url_decode($encoded);
    $encoded    = $q->url_encode($unencoded);
    $escaped    = $q->escapeHTML('<>"&');
    $unescaped  = $q->unescapeHTML('&lt;&gt;&quot;&amp;');

    $qs = $q->query_string; # get all data in $q as a query string OK for GET

lib/CGI/Simple.pm  view on Meta::CPAN


=head2 url_decode() Decode a URL encoded string

This method will correctly decode a url encoded string.

    $decoded = $q->url_decode( $encoded );

=head2 url_encode() URL encode a string

This method will correctly URL encode a string.

 view all matches for this distribution


CGI-Test-Input-Custom

 view release on metacpan or  search on metacpan

lib/CGI/Test/Input/Custom.pm  view on Meta::CPAN

sub new {
    my ($class, %args) = @_;
    my $this = bless {}, $class;
    $this->_init;
    $this->{_ctic_mime_type} = _firstdef(delete $args{-mime_type}, 'application/octet-stream');
    $this->{_data_decoded} = _firstdef(delete $args{-content}, '');
    $this->{_encoding} = _firstdef(delete $args{-encoding}, 'utf8');
    %args and croak "unsupported constructor argument(s) ".join(', ', keys %args);
    $this->{stale} = 1;
    $this;
}

lib/CGI/Test/Input/Custom.pm  view on Meta::CPAN


sub mime_type { shift->{_ctic_mime_type} }

sub _build_data {
    my $this = shift;
    encode($this->{_encoding}, $this->{_data_decoded})
}

sub add_content {
    my $this = shift;
    $this->{_data_decoded} .= join('', @_);
    $this->{stale} = 1;
}



 view all matches for this distribution


CGI-Tiny

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


      $cgi = $cgi->set_multipart_form_charset('UTF-8');

    Sets the default charset for decoding multipart/form-data forms,
    defaults to UTF-8. Parameter and upload field names, upload filenames,
    and text parameter values that don't specify a charset will be decoded
    from this charset. Set to an empty string to disable this decoding,
    effectively interpreting such values in ISO-8859-1.

  set_input_handle

README  view on Meta::CPAN


    Retrieve URL query string parameters and
    application/x-www-form-urlencoded or multipart/form-data body
    parameters as an ordered array reference of name/value pairs,
    represented as two-element array references. Names and values are
    decoded to Unicode characters.

    Query parameters are returned first, followed by body parameters. Use
    "query_params" or "body_params" to retrieve query or body parameters
    separately.

README  view on Meta::CPAN


      my $arrayref = $cgi->param_names;

    Retrieve URL query string parameter names and
    application/x-www-form-urlencoded or multipart/form-data body parameter
    names, decoded to Unicode characters, as an ordered array reference,
    without duplication.

    Query parameter names are returned first, followed by body parameter
    names. Use "query_param_names" or "body_param_names" to retrieve query
    or body parameter names separately.

README  view on Meta::CPAN


      my $value = $cgi->param('foo');

    Retrieve value of a named URL query string parameter or
    application/x-www-form-urlencoded or multipart/form-data body
    parameter, decoded to Unicode characters.

    If the parameter name was passed multiple times, returns the last body
    parameter value if any, otherwise the last query parameter value. Use
    "param_array" to get multiple values of a parameter, or "query_param"
    or "body_param" to retrieve the last query or body parameter value

README  view on Meta::CPAN


      my $arrayref = $cgi->param_array('foo');

    Retrieve values of a named URL query string parameter or
    application/x-www-form-urlencoded or multipart/form-data body
    parameter, decoded to Unicode characters, as an ordered array
    reference.

    Query parameter values will be returned first, followed by body
    parameter values. Use "query_param_array" or "body_param_array" to
    retrieve query or body parameter values separately.

README  view on Meta::CPAN


      my $pairs = $cgi->query_params;

    Retrieve URL query string parameters as an ordered array reference of
    name/value pairs, represented as two-element array references. Names
    and values are decoded to Unicode characters.

  query_param_names

      my $arrayref = $cgi->query_param_names;

    Retrieve URL query string parameter names, decoded to Unicode
    characters, as an ordered array reference, without duplication.

  query_param

      my $value = $cgi->query_param('foo');

    Retrieve value of a named URL query string parameter, decoded to
    Unicode characters.

    If the parameter name was passed multiple times, returns the last
    value. Use "query_param_array" to get multiple values of a parameter.

  query_param_array

      my $arrayref = $cgi->query_param_array('foo');

    Retrieve values of a named URL query string parameter, decoded to
    Unicode characters, as an ordered array reference.

  body

      my $bytes = $cgi->body;

README  view on Meta::CPAN

      my $pairs = $cgi->body_params;

    Retrieve application/x-www-form-urlencoded or multipart/form-data body
    parameters as an ordered array reference of name/value pairs,
    represented as two-element array references. Names and values are
    decoded to Unicode characters.

    NOTE: This will read the text form fields into memory, so make sure the
    "set_request_body_limit" can fit well within the available memory.
    multipart/form-data file uploads will be streamed to temporary files
    accessible via "uploads" and related methods.

README  view on Meta::CPAN

  body_param_names

      my $arrayref = $cgi->body_param_names;

    Retrieve application/x-www-form-urlencoded or multipart/form-data body
    parameter names, decoded to Unicode characters, as an ordered array
    reference, without duplication.

    NOTE: This will read the text form fields into memory as in
    "body_params".

  body_param

      my $value = $cgi->body_param('foo');

    Retrieve value of a named application/x-www-form-urlencoded or
    multipart/form-data body parameter, decoded to Unicode characters.

    If the parameter name was passed multiple times, returns the last
    value. Use "body_param_array" to get multiple values of a parameter.

    NOTE: This will read the text form fields into memory as in

README  view on Meta::CPAN

  body_param_array

      my $arrayref = $cgi->body_param_array('foo');

    Retrieve values of a named application/x-www-form-urlencoded or
    multipart/form-data body parameter, decoded to Unicode characters, as
    an ordered array reference.

    NOTE: This will read the text form fields into memory as in
    "body_params".

README  view on Meta::CPAN


      my $pairs = $cgi->uploads;

    Retrieve multipart/form-data file uploads as an ordered array reference
    of name/upload pairs, represented as two-element array references.
    Names are decoded to Unicode characters.

    NOTE: This will read the text form fields into memory, so make sure the
    "set_request_body_limit" can fit well within the available memory.

    File uploads are represented as a hash reference containing the

README  view on Meta::CPAN


  upload_names

      my $arrayref = $cgi->upload_names;

    Retrieve multipart/form-data file upload names, decoded to Unicode
    characters, as an ordered array reference, without duplication.

    NOTE: This will read the text form fields into memory as in "uploads".

  upload

README  view on Meta::CPAN

    date string if not set manually.

    If the "request_method" is HEAD, any provided response content will be
    ignored (other than redirect URLs) and Content-Length will be set to 0.

    text, html, or xml data is expected to be decoded Unicode characters,
    and will be encoded according to "set_response_charset" (UTF-8 by
    default). Unicode::UTF8 will be used for efficient UTF-8 encoding if
    available.

    json data structures will be encoded to JSON and UTF-8.

README  view on Meta::CPAN

    date string if not set manually.

    If the "request_method" is HEAD, any provided response content will be
    ignored.

    text, html, or xml data is expected to be decoded Unicode characters,
    and will be encoded according to "set_response_charset" (UTF-8 by
    default). Unicode::UTF8 will be used for efficient UTF-8 encoding if
    available.

    json data structures will be encoded to JSON and UTF-8.

 view all matches for this distribution


CGI-Untaint-Facebook

 view release on metacpan or  search on metacpan

lib/CGI/Untaint/Facebook.pm  view on Meta::CPAN

			# was a timeout
			carp "$url: ", $webdoc->status_line();
		}
		return 0;
	}
	my $response = $browser->decoded_content();
	if($response =~ /This content isn't available at the moment/mis) {
		return 0;
	}
	return 1;
}

 view all matches for this distribution


CGI-Utils

 view release on metacpan or  search on metacpan

lib/CGI/Utils.pm  view on Meta::CPAN


=pod

=head2 urlDecode($url_encoded_str)

Returns the decoded version of the given URL-encoded string.

Aliases: url_decode()

=cut
    sub urlDecode {

lib/CGI/Utils.pm  view on Meta::CPAN


=pod

=head2 urlUnicodeDecode($url_encoded_str)

Returns the decoded version of the given URL-encoded string,
with unicode support.

Aliases: url_unicode_decode()

=cut

 view all matches for this distribution


CGI-Widget-DBI-Browse

 view release on metacpan or  search on metacpan

lib/CGI/Widget/DBI/Browse.pm  view on Meta::CPAN

            $col_found = 1;
            last;
        }
    }
    my $extra_vars = $self->{ws}->extra_vars_for_uri([ @{ $self->{'filter_columns'} }, '_browse_skip_to_results_', @exclude_params ]);
    my $category_decoded = $self->decode_utf8($row->{$category_col});
    return $col_found
      ? '<a href="?'.join('&amp;', (map { _uri_param_pair($_, $self->decode_utf8($row->{$_})) } @cols), $extra_vars || ()).'" id="jumpToCategoryLink">'
        .$category_decoded.'</a>'
      : $category_decoded;
}

sub _category_columndata_closure {
    my ($self, $category_col) = @_;
    my $existing_category_filters =

lib/CGI/Widget/DBI/Browse.pm  view on Meta::CPAN

    my $before_link_closure = $self->{-category_before_link_closures}->{$category_col};
    my $column_closure = $self->{-category_column_closures}->{$category_col};
    my @filter_columns = @{ $self->{'filter_columns'} };
    return sub {
        my ($sd, $row) = @_;
        my $category_decoded = $sd->decode_utf8($row->{$category_col}) || '(empty)';
        my $category_display_value = ref $column_closure eq 'CODE' ? $column_closure->($sd, $row) : $category_decoded;
        my $extra_vars = $sd->extra_vars_for_uri([ @filter_columns, '_browse_skip_to_results_' ]);
        return ($before_link_closure ? $before_link_closure->($sd, $row) : '').'<a href="?'.join(
            '&amp;', $existing_category_filters || (),
            _uri_param_pair($category_col, $category_decoded),
            $extra_vars || (),
        ).'" id="categoryNavLink-'.CGI::escapeHTML($category_decoded).'">'.$category_display_value.'</a>'; # TODO: HTML::Escape is faster than CGI
    };
}


1;

 view all matches for this distribution


CGI

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

     Thanks to Britton Kerin and Yanick Campoux. (RT#43587)
  10.hidden() now correctly supports multiple default values.
     Thanks to david@dierauer.net and Russell Jenkins. (RT#20436)
  11.Calling CGI->new() no longer clobbers the value of $_ in the current scope.
     Thanks to Alexey Tourbin, Bob Kuo and Mark Stosberg. (RT#25131)
  12.UTF-8 params should not get double-decoded now.
     Thanks to Yves, Bodo, Burak G�rsoy, and Michael Schout. (RT#19913)
  13.We now give objects passed to CGI::Carp::die a chance to be stringified.
     Thanks to teek and Yanick Champoux (RT#41530)
  14.Turning off autoEscape() now only affects the behavior of built-in HTML
     generation fuctions. Explicit calls to escapeHTML() always escape HTML regardless

 view all matches for this distribution


CGI_Lite

 view release on metacpan or  search on metacpan

CGI_Lite.pm  view on Meta::CPAN

    $cgi->create_variables ($form);

    $escaped_string = browser_escape ($string);

    $encoded_string = url_encode ($string);
    $decoded_string = url_decode ($string);

    $status = is_dangerous ($string);
    $safe_string = escape_dangerous_chars ($string);

=head1 DESCRIPTION

CGI_Lite.pm  view on Meta::CPAN

=item B<parse_form_data>

This will handle the following types of requests: GET, HEAD and POST.
By default, CGI_Lite uses the environment variable REQUEST_METHOD to 
determine the manner in which the query/form information should be 
decoded. However, as of v1.8, you are allowed to pass a valid request 
method to this function to force CGI_Lite to decode the information in 
a specific manner. 

For multipart/form-data, uploaded files are stored in the user selected 
directory (see B<set_directory>). If timestamp mode is on (see 

CGI_Lite.pm  view on Meta::CPAN


You can use this method to URL decode a string. 

I<Return Value>

URL decoded string.

=item B<is_dangerous>

This method checks for the existence of dangerous meta-characters.

 view all matches for this distribution


CHI

 view release on metacpan or  search on metacpan

lib/CHI.pm  view on Meta::CPAN

deserialized after retrieving - see L</serializer>.

=item *

Values with their utf8 flag on are utf8 encoded before storing, and utf8
decoded after retrieving.

=back

=head1 SUBCACHES

 view all matches for this distribution


CLI-Dispatch

 view release on metacpan or  search on metacpan

lib/CLI/Dispatch/Command.pm  view on Meta::CPAN

      $self->log( info => 'going to convert encoding' );

      # debug message will be printed only when "debug" option is set
      $self->log( debug => 'going to convert encoding' );

      my $decoded = decode( $self->option('from'), $args[0] );
      print encode( $self->option('to'), $decoded );
    }

    1;

    __END__

 view all matches for this distribution


( run in 1.068 second using v1.01-cache-2.11-cpan-9383018d099 )