view release on metacpan or search on metacpan
local/lib/perl5/PPI/Structure/Constructor.pm
local/lib/perl5/PPI/Structure/For.pm
local/lib/perl5/PPI/Structure/Given.pm
local/lib/perl5/PPI/Structure/List.pm
local/lib/perl5/PPI/Structure/Subscript.pm
local/lib/perl5/PPI/Structure/Unknown.pm
local/lib/perl5/PPI/Structure/When.pm
local/lib/perl5/PPI/Token.pm
local/lib/perl5/PPI/Token/ArrayIndex.pm
local/lib/perl5/PPI/Token/Attribute.pm
local/lib/perl5/PPI/Token/BOM.pm
local/lib/perl5/PPI/Token/Cast.pm
local/lib/perl5/PPI/Token/Comment.pm
local/lib/perl5/PPI/Token/DashedWord.pm
local/lib/perl5/PPI/Token/Data.pm
local/lib/perl5/PPI/Token/End.pm
local/lib/perl5/PPI/Token/HereDoc.pm
local/lib/perl5/PPI/Token/Label.pm
local/lib/perl5/PPI/Token/Magic.pm
local/lib/perl5/PPI/Token/Number.pm
local/lib/perl5/PPI/Token/Number/Binary.pm
SHA256 75921dfcc76f0aa9bbd398b460d9c3d9a12caf70c2c2a9fd5224d69744c1f812 local/lib/perl5/PPI/Structure/Constructor.pm
SHA256 be12b9eab56d75cd1fe892f7b991c23b6ade5fd28d96cad213a3af8062f5258f local/lib/perl5/PPI/Structure/For.pm
SHA256 1e464bd03dad573e95c0567ab1a7ab6b4ee4071c4e7df6a182c0ec410191783f local/lib/perl5/PPI/Structure/Given.pm
SHA256 ed33860a23f8e2b03ae8c1e07e69ce8d3d8153c920e18692740c56c1d60bbb66 local/lib/perl5/PPI/Structure/List.pm
SHA256 b1604f952e6a85419cd97dba36bcb73c4de9d0ea42544a632495d2f74cbdd6b6 local/lib/perl5/PPI/Structure/Subscript.pm
SHA256 9024114c0993615d7e97dd9b9cab60ada884072c73a940ec6abf939a9462615b local/lib/perl5/PPI/Structure/Unknown.pm
SHA256 d1c0f3560db18b11ad1fd9603a0d95deae09469d92f0639f6033c88b35578e3e local/lib/perl5/PPI/Structure/When.pm
SHA256 337a4fdf1a60010c039fb1f13878c02fad32dcbe1fc33e9cfd6c57dde08c802e local/lib/perl5/PPI/Token.pm
SHA256 46e475ddf565a29b0a982743be32e7eff31cd7d48f8db636d1494a7336764f50 local/lib/perl5/PPI/Token/ArrayIndex.pm
SHA256 04ce9dc68a4f326670916da5d56803dd7e7820dfc77e2bbe0d28b16d3e91f735 local/lib/perl5/PPI/Token/Attribute.pm
SHA256 894cbcb38c4946c385f473383569b74f937af7ca4d5aa28b2812e2e25235f9df local/lib/perl5/PPI/Token/BOM.pm
SHA256 bdefe7462b8eb053d90eb92918c878f0dffa4c6984d7d19d610f518da9456787 local/lib/perl5/PPI/Token/Cast.pm
SHA256 8da92e6f4b258fac1f697e5015e890cb44fbd7c24f73e3768c6130aec68aedfd local/lib/perl5/PPI/Token/Comment.pm
SHA256 5cb2568a6ba8eb561f03121d6375917f1545df9ad04de5d652ea153a0aef186b local/lib/perl5/PPI/Token/DashedWord.pm
SHA256 8f6cc381411826fef64484d9071f764c3dc069b7e45e7a5f24fd20bad809cb92 local/lib/perl5/PPI/Token/Data.pm
SHA256 4a900a289799104a56cae7070548f32f7dd4d9044d0197bdf7932e809ce11537 local/lib/perl5/PPI/Token/End.pm
SHA256 6a4a0101998cf4c0ece97b24952ff1946a3ab3901f2057cdda6ad96437f67e47 local/lib/perl5/PPI/Token/HereDoc.pm
SHA256 145c83af714b27785259684be8c8993f606d74415326800210c0e8b16139e703 local/lib/perl5/PPI/Token/Label.pm
SHA256 ab20c195afd25afbe21e2f53acbce881c4eb818c8eeba0959ad849402dc9041d local/lib/perl5/PPI/Token/Magic.pm
SHA256 0090081713e95a105ea75336e337f8c730aa164dff3018de518a2c2980715d17 local/lib/perl5/PPI/Token/Number.pm
SHA256 768ca6c115a0fd5bdd30b0ac51d149bd317c2c95cdcb0ee9e8e0801c4c8befe8 local/lib/perl5/PPI/Token/Number/Binary.pm
cpanfile.snapshot view on Meta::CPAN
PPI::Structure::Constructor 1.276
PPI::Structure::For 1.276
PPI::Structure::Given 1.276
PPI::Structure::List 1.276
PPI::Structure::Subscript 1.276
PPI::Structure::Unknown 1.276
PPI::Structure::When 1.276
PPI::Token 1.276
PPI::Token::ArrayIndex 1.276
PPI::Token::Attribute 1.276
PPI::Token::BOM 1.276
PPI::Token::Cast 1.276
PPI::Token::Comment 1.276
PPI::Token::DashedWord 1.276
PPI::Token::Data 1.276
PPI::Token::End 1.276
PPI::Token::HereDoc 1.276
PPI::Token::Label 1.276
PPI::Token::Magic 1.276
PPI::Token::Number 1.276
PPI::Token::Number::Binary 1.276
local/cache/modules/02packages.details.txt view on Meta::CPAN
PPI::Structure::Constructor 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Structure::For 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Structure::Given 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Structure::List 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Structure::Subscript 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Structure::Unknown 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Structure::When 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::ArrayIndex 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::Attribute 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::BOM 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::Cast 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::Comment 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::DashedWord 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::Data 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::End 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::HereDoc 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::Label 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::Magic 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::Number 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
PPI::Token::Number::Binary 1.276 O/OA/OALDERS/PPI-1.276.tar.gz
local/lib/perl5/Config/INI/Reader.pm view on Meta::CPAN
#pod =cut
sub read_handle {
my ($invocant, $handle) = @_;
my $self = ref $invocant ? $invocant : $invocant->new;
# parse the file
LINE: while (my $line = $handle->getline) {
if ($handle->input_line_number == 1 && $line =~ /\A\x{FEFF}/) {
Carp::confess("input handle appears to start with a BOM");
}
$self->preprocess_line(\$line);
next LINE if $self->can_ignore($line, $handle);
# Handle section headers
if (defined (my $name = $self->parse_section_header($line, $handle))) {
# Create the sub-hash if it doesn't exist.
# Without this sections without keys will not
local/lib/perl5/Dist/Zilla/Role/File.pm view on Meta::CPAN
my $enc = $self->encoding;
if ( $self->is_bytes ) {
$self->_throw(decode => "Can't decode text from 'bytes' encoding");
}
else {
require Encode;
my $text =
try { Encode::decode($enc, $bytes, Encode::FB_CROAK()) }
catch { $self->_throw("decode $enc" => $_) };
# Okay, look, buddy⦠If you're using a BOM on UTF-8, that's fine. You can
# use it. You're just not going to get it back. If we don't do this, the
# sequence of events will be:
# * read file from UTF-8-BOM file on disk
# * end up with FEFF as first character of file
# * pass file content to PPI
# * PPI blows up
#
# I'm not going to try to account for the BOM and add it back. It's awful!
#
# Meanwhile, if you're using UTF-16, you can get the BOM handled by picking
# the right encoding type, I think. -- rjbs, 2016-04-24
$enc =~ /^utf-?8$/i && $text =~ s/\A\x{FEFF}//;
return $text;
}
}
sub _throw {
my ($self, $op, $msg) = @_;
my ($name, $added_by) = map {; $self->$_ } qw/name added_by/;
local/lib/perl5/HTTP/Message.pm view on Meta::CPAN
sub content_charset
{
my $self = shift;
if (my $charset = $self->content_type_charset) {
return $charset;
}
# time to start guessing
my $cref = $self->decoded_content(ref => 1, charset => "none");
# Unicode BOM
for ($$cref) {
return "UTF-8" if /^\xEF\xBB\xBF/;
return "UTF-32LE" if /^\xFF\xFE\x00\x00/;
return "UTF-32BE" if /^\x00\x00\xFE\xFF/;
return "UTF-16LE" if /^\xFF\xFE/;
return "UTF-16BE" if /^\xFE\xFF/;
}
if ($self->content_is_xml) {
# http://www.w3.org/TR/2006/REC-xml-20060816/#sec-guessing
local/lib/perl5/IO/HTML.pm view on Meta::CPAN
my $pos = tell $in;
croak "Could not seek $filename: $!" if $pos < 0;
croak "Could not read $filename: $!"
unless defined read $in, my($buf), $bytes_to_check;
seek $in, $pos, 0 or croak "Could not seek $filename: $!";
# Check for BOM:
my $bom;
my $encoding = do {
if ($buf =~ /^\xFe\xFF/) {
$bom = 2;
'UTF-16BE';
} elsif ($buf =~ /^\xFF\xFe/) {
$bom = 2;
'UTF-16LE';
} elsif ($buf =~ /^\xEF\xBB\xBF/) {
$bom = 3;
local/lib/perl5/IO/HTML.pm view on Meta::CPAN
=head1 SUBROUTINES
=head2 html_file
$filehandle = html_file($filename, \%options);
This function (exported by default) is the primary entry point. It
opens the file specified by C<$filename> for reading, uses
C<sniff_encoding> to find a suitable encoding layer, and applies it.
It also applies the C<:crlf> layer. If the file begins with a BOM,
the filehandle is positioned just after the BOM.
The optional second argument is a hashref containing options. The
possible keys are described under C<find_charset_in>.
If C<sniff_encoding> is unable to determine the encoding, it defaults
to C<$IO::HTML::default_encoding>, which is set to C<cp1252>
(a.k.a. Windows-1252) by default. According to the standard, the
default should be locale dependent, but that is not currently
implemented.
local/lib/perl5/IO/HTML.pm view on Meta::CPAN
=head2 html_file_and_encoding
($filehandle, $encoding, $bom)
= html_file_and_encoding($filename, \%options);
This function (exported only by request) is just like C<html_file>,
but returns more information. In addition to the filehandle, it
returns the name of the encoding used, and a flag indicating whether a
byte order mark was found (if C<$bom> is true, the file began with a
BOM). This may be useful if you want to write the file out again
(especially in conjunction with the C<html_outfile> function).
The optional second argument is a hashref containing options. The
possible keys are described under C<find_charset_in>.
It dies if the file cannot be opened, or if C<sniff_encoding> cannot
determine the encoding and C<$IO::HTML::default_encoding> has been set
to C<undef>.
The result of calling C<html_file_and_encoding> in scalar context is undefined
(in the C sense of there is no guarantee what you'll get).
=head2 html_outfile
$filehandle = html_outfile($filename, $encoding, $bom);
This function (exported only by request) opens C<$filename> for output
using C<$encoding>, and writes a BOM to it if C<$bom> is true.
If C<$encoding> is C<undef>, it defaults to C<$IO::HTML::default_encoding>.
C<$encoding> may be either an encoding name or an Encode::Encoding object.
It dies if the file cannot be opened, or if both C<$encoding> and
C<$IO::HTML::default_encoding> are C<undef>.
=head2 sniff_encoding
($encoding, $bom) = sniff_encoding($filehandle, $filename, \%options);
local/lib/perl5/IO/HTML.pm view on Meta::CPAN
C<find_charset_in>.
It returns Perl's canonical name for the encoding, which is not
necessarily the same as the MIME or IANA charset name. It returns
C<undef> if the encoding cannot be determined. C<$bom> is true if the
file began with a byte order mark. In scalar context, it returns only
C<$encoding>.
The filehandle's position is restored to its original position
(normally the beginning of the file) unless C<$bom> is true. In that
case, the position is immediately after the BOM.
Tip: If you want to run C<sniff_encoding> on a file you've already
loaded into a string, open an in-memory file on the string, and pass
that handle:
($encoding, $bom) = do {
open(my $fh, '<', \$string); sniff_encoding($fh)
};
(This only makes sense if C<$string> contains bytes, not characters.)
=head2 find_charset_in
$encoding = find_charset_in($string_containing_HTML, \%options);
This function (exported only by request) looks for charset information
in a C<< <meta> >> tag in a possibly-incomplete HTML document using
the "two step" algorithm specified by HTML5. It does not look for a BOM.
The C<< <meta> >> tag must begin within the first C<$IO::HTML::bytes_to_check>
bytes of the string.
It returns Perl's canonical name for the encoding, which is not
necessarily the same as the MIME or IANA charset name. It returns
C<undef> if no charset is specified or if the specified charset is not
recognized by the Encode module.
The optional second argument is a hashref containing options. The
following keys are recognized:
local/lib/perl5/Mozilla/CA/cacert.pem view on Meta::CPAN
4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo
2qN8xcL4dJIEG4aspCJTQLas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wqHAAVF41og9JwnxgI
zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn
local/lib/perl5/Mozilla/CA/cacert.pem view on Meta::CPAN
LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0
oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC
wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS
CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN
rJgWVqA=
-----END CERTIFICATE-----
Buypass Class 3 Root CA
=======================
-----BEGIN CERTIFICATE-----
MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU
QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X
DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1
eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw
DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH
sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR
5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh
7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ
ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH
2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV
/afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ
local/lib/perl5/Mozilla/CA/cacert.pem view on Meta::CPAN
bmV0L2NybC9kLXRydXN0X2V2X3Jvb3RfY2FfMV8yMDIwLmNybDB5oHegdYZzbGRhcDovL2RpcmVj
dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwRVYlMjBSb290JTIwQ0ElMjAxJTIwMjAyMCxP
PUQtVHJ1c3QlMjBHbWJILEM9REU/Y2VydGlmaWNhdGVyZXZvY2F0aW9ubGlzdDAKBggqhkjOPQQD
AwNpADBmAjEAyjzGKnXCXnViOTYAYFqLwZOZzNnbQTs7h5kXO9XMT8oi96CAy/m0sRtW9XLS/BnR
AjEAkfcwkz8QRitxpNA7RJvAKQIFskF3UfN5Wp6OFKBOQtJbgfM0agPnIjhQW+0ZT0MW
-----END CERTIFICATE-----
DigiCert TLS ECC P384 Root G5
=============================
-----BEGIN CERTIFICATE-----
MIICGTCCAZ+gAwIBAgIQCeCTZaz32ci5PhwLBCou8zAKBggqhkjOPQQDAzBOMQswCQYDVQQGEwJV
UzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJjAkBgNVBAMTHURpZ2lDZXJ0IFRMUyBFQ0MgUDM4
NCBSb290IEc1MB4XDTIxMDExNTAwMDAwMFoXDTQ2MDExNDIzNTk1OVowTjELMAkGA1UEBhMCVVMx
FzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMuMSYwJAYDVQQDEx1EaWdpQ2VydCBUTFMgRUNDIFAzODQg
Um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view on Meta::CPAN
use PPI::Exception ();
our $VERSION = '1.276';
our @ISA = 'PPI::Element';
# We don't load the abstracts, they are loaded
# as part of the inheritance process.
# Load the token classes
use PPI::Token::BOM ();
use PPI::Token::Whitespace ();
use PPI::Token::Comment ();
use PPI::Token::Pod ();
use PPI::Token::Number ();
use PPI::Token::Number::Binary ();
use PPI::Token::Number::Octal ();
use PPI::Token::Number::Hex ();
use PPI::Token::Number::Float ();
use PPI::Token::Number::Exp ();
use PPI::Token::Number::Version ();
local/lib/perl5/PPI/Token/BOM.pm view on Meta::CPAN
package PPI::Token::BOM;
=pod
=head1 NAME
PPI::Token::BOM - Tokens representing Unicode byte order marks
=head1 INHERITANCE
PPI::Token::BOM
isa PPI::Token
isa PPI::Element
=head1 DESCRIPTION
This is a special token in that it can only occur at the beginning of
documents. If a BOM byte mark occurs elsewhere in a file, it should
be treated as L<PPI::Token::Whitespace>. We recognize the byte order
marks identified at this URL:
L<http://www.unicode.org/faq/utf_bom.html#BOM>
UTF-32, big-endian 00 00 FE FF
UTF-32, little-endian FF FE 00 00
UTF-16, big-endian FE FF
UTF-16, little-endian FF FE
UTF-8 EF BB BF
Note that as of this writing, PPI only has support for UTF-8
(namely, in POD and strings) and no support for UTF-16 or UTF-32. We
support the BOMs of the latter two for completeness only.
The BOM is considered non-significant, like white space.
=head1 METHODS
There are no additional methods beyond those provided by the parent
L<PPI::Token> and L<PPI::Element> classes.
=cut
use strict;
use PPI::Token ();
local/lib/perl5/PPI/Token/BOM.pm view on Meta::CPAN
\xfe\xff | # UTF-16, big-endian
\xff\xfe | # UTF-16, little-endian
\xef\xbb\xbf) # UTF-8
/xs) {
my $bom = $1;
if ($bom_types{$bom} ne 'UTF-8') {
return $t->_error("$bom_types{$bom} is not supported");
}
$t->_new_token('BOM', $bom) or return undef;
$t->{line_cursor} += length $bom;
}
# Continue just as if there was no BOM
$t->{class} = 'PPI::Token::Whitespace';
return $t->{class}->__TOKENIZER__on_line_start($t);
}
1;
=pod
=head1 SUPPORT
local/lib/perl5/PPI/Tokenizer.pm view on Meta::CPAN
source_bytes => undef,
# Line buffer
line => undef,
line_length => undef,
line_cursor => undef,
line_count => 0,
# Parse state
token => undef,
class => 'PPI::Token::BOM',
zone => 'PPI::Token::Whitespace',
# Output token buffer
tokens => [],
token_cursor => 0,
token_eof => 0,
# Perl 6 blocks
perl6 => [],
}, $class;
local/lib/perl5/Perl/Tidy.pm view on Meta::CPAN
}
# Set the encoding to be used for all further i/o: If we have
# decoded the data with any format, then we must continue to
# read and write it as encoded data, and we will normalize these
# operations with utf8. If we have not decoded the data, then
# we must not treat it as encoded data.
my $is_encoded_data = $encoding_in ? 'utf8' : EMPTY_STRING;
$self->[_is_encoded_data_] = $is_encoded_data;
# Delete any Byte Order Mark (BOM), which can cause trouble
if ($is_encoded_data) {
$buf =~ s/^\x{FEFF}//;
}
$rstatus->{'input_name'} = $display_name;
$rstatus->{'opt_encoding'} = $rOpts_character_encoding;
$rstatus->{'char_mode_used'} = $encoding_in ? 1 : 0;
$rstatus->{'input_decoded_as'} = $decoded_input_as;
# Define the function to determine the display width of character
local/lib/perl5/YAML/Tiny.pm view on Meta::CPAN
if ( utf8::is_utf8($string) && ! utf8::valid($string) ) {
die \<<'...';
Read an invalid UTF-8 string (maybe mixed UTF-8 and 8-bit character set).
Did you decode with lax ":utf8" instead of strict ":encoding(UTF-8)"?
...
}
# Ensure Unicode character semantics, even for 0x80-0xff
utf8::upgrade($string);
# Check for and strip any leading UTF-8 BOM
$string =~ s/^\x{FEFF}//;
# Check for some special cases
return $self unless length $string;
# Split the file into lines
my @lines = grep { ! /^\s*(?:\#.*)?\z/ }
split /(?:\015{1,2}\012|\015|\012)/, $string;
# Strip the initial YAML header
local/lib/perl5/x86_64-linux-thread-multi/Cpanel/JSON/XS.pm view on Meta::CPAN
tests. In fact it is the only know JSON decoder which does so,
while also being the fastest.
- support many more options and methods from JSON::PP:
stringify_infnan, allow_unknown, allow_stringify, allow_barekey,
encode_stringify, allow_bignum, allow_singlequote, dupkeys_as_arrayref,
sort_by (partially), escape_slash, convert_blessed, ...
optional decode_json(, allow_nonref) arg.
relaxed implements allow_dupkeys.
- support all 5 unicode L<BOM|/BOM>'s: UTF-8, UTF-16LE, UTF-16BE, UTF-32LE,
UTF-32BE, encoding internally to UTF-8.
=cut
our @ISA = qw(Exporter);
our @EXPORT = qw(encode_json decode_json to_json from_json);
sub to_json($@) {
if ($] >= 5.008) {
require Carp;
local/lib/perl5/x86_64-linux-thread-multi/Cpanel/JSON/XS.pm view on Meta::CPAN
# else add more data
sysread $fh, my $buf, 65536
or die "read error: $!";
$json->incr_parse ($buf); # void context, so no parsing
}
This is a complex example, but most of the complexity comes from the fact
that we are trying to be correct (bear with me if I am wrong, I never ran
the above example :).
=head1 BOM
Detect all unicode B<Byte Order Marks> on decode.
Which are UTF-8, UTF-16LE, UTF-16BE, UTF-32LE and UTF-32BE.
The BOM encoding is set only for one specific decode call, it does not
change the state of the JSON object.
B<Warning>: With perls older than 5.20 you need load the Encode module
before loading a multibyte BOM, i.e. >= UTF-16. Otherwise an error is
thrown. This is an implementation limitation and might get fixed later.
See L<https://tools.ietf.org/html/rfc7159#section-8.1>
I<"JSON text SHALL be encoded in UTF-8, UTF-16, or UTF-32.">
I<"Implementations MUST NOT add a byte order mark to the beginning of a
JSON text", "implementations (...) MAY ignore the presence of a byte
order mark rather than treating it as an error".>
See also L<http://www.unicode.org/faq/utf_bom.html#BOM>.
Beware that Cpanel::JSON::XS is currently the only JSON module which
does accept and decode a BOM.
The latest JSON spec
L<https://www.greenbytes.de/tech/webdav/rfc8259.html#character.encoding>
forbid the usage of UTF-16 or UTF-32, the character encoding is UTF-8.
Thus in subsequent updates BOM's of UTF-16 or UTF-32 will throw an error.
=head1 MAPPING
This section describes how Cpanel::JSON::XS maps Perl values to JSON
values and vice versa. These mappings are designed to "do the right
thing" in most circumstances automatically, preserving round-tripping
characteristics (what you put in comes out as something equivalent).
For the more enlightened: note that in the following descriptions,
lowercase I<perl> refers to the Perl interpreter, while uppercase I<Perl>
local/lib/perl5/x86_64-linux-thread-multi/HTML/HeadParser.pm view on Meta::CPAN
print "END[$tag]\n" if $DEBUG;
$self->flush_text if $self->{'tag'};
$self->eof if $tag eq 'head';
}
sub text
{
my($self, $text) = @_;
print "TEXT[$text]\n" if $DEBUG;
unless ($self->{first_chunk}) {
# drop Unicode BOM if found
if ($self->utf8_mode) {
$text =~ s/^\xEF\xBB\xBF//;
}
else {
$text =~ s/^\x{FEFF}//;
}
$self->{first_chunk}++;
}
my $tag = $self->{tag};
if (!$tag && $text =~ /\S/) {
local/lib/perl5/x86_64-linux-thread-multi/HTML/Parser.pm view on Meta::CPAN
opened in ":utf8" mode.
The alternative solution is to enable the C<utf8_mode> and not decode before
passing strings to $p->parse(). The parser can process raw undecoded UTF-8
sanely if the C<utf8_mode> is enabled, or if the C<attr>, C<@attr> or C<dtext>
argspecs are avoided.
=item Parsing string decoded with wrong endian selection
(W) The first character in the document is U+FFFE. This is not a
legal Unicode character but a byte swapped C<BOM>. The result of parsing
will likely be garbage.
=item Parsing of undecoded UTF-32
(W) The parser found the Unicode UTF-32 C<BOM> signature at the start
of the document. The result of parsing will likely be garbage.
=item Parsing of undecoded UTF-16
(W) The parser found the Unicode UTF-16 C<BOM> signature at the start of
the document. The result of parsing will likely be garbage.
=back
=head1 SEE ALSO
L<HTML::Entities>, L<HTML::PullParser>, L<HTML::TokeParser>, L<HTML::HeadParser>,
L<HTML::LinkExtor>, L<HTML::Form>
L<HTML::TreeBuilder> (part of the I<HTML-Tree> distribution)