view release on metacpan or search on metacpan
lib/Geo/Code/XYZ.pm view on Meta::CPAN
my %altmap = ( 'A'=>'0','B'=>'1','C'=>'2','D'=>'3','E'=>'4','F'=>'5','G'=>'6','H'=>'7','I'=>'8','J'=>'9','K'=>'10','L'=>'11','M'=>'12','N'=>'13','O'=>'14','P'=>'15','Q'=>'16','R'=>'17','S'=>'18','T'=>'19','U'=>'20','V'=>'21','W'=>'22','X'=>'23','Y'=>...
use constant ALPHANUMERIC => [ 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z ];
use constant GEONAMETRIPLE => [
ZERO,OC,OH,OY,OK,QY,UC,UX,XU,AH,AQ,AZ,BY,CE,DY,EF,EP,EQ,EX,HY,YD,YI,YM,IQ,YR,YS,AAH,AAS,ABB,ABC,ABL,ABN,ABP,ABS,ABV,ACC,ACY,ACT,ADC,ADJ,ADP,ADS,ADV,ADZ,AEQ,AER,AES,AFB,AFD,AFT,AGY,AGT,AHT,AIX,ALC,ALG,ALN,ALP,ALS,ALW,AMB,AMT,ANI,ANS,AOB,AOR,APH,APL,AP...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Code/XYZEN.pm view on Meta::CPAN
use constant ALPHANUMERIC => [ 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z ];
use constant GEONAMETRIPLE => [
KABWE,PLANKAGE,LAWRENSON,HALOXENE,EUNUCHAL,SQUIER,BRODHEAD,GLISSADE,KOZHIKODE,NEWBORN,ZONOID,PREZNIT,SOROLLA,FICKORGIE,WAYBIRD,DIG,ESPIO,AMPED,LIMULUS,PROCITY,GOOOF,NISHI,CHARAN,KWANZAA,CULLIMORE,SAICES,MESENTERY,JUGOSLAV,ALNOITE,BARTIN,HEXEREI,TURJI...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Code.pm view on Meta::CPAN
use constant DEBUG => 0;
use constant BASEN => 146300;
use constant BASEA => 36;
use constant PADD => 282699884614999;
use constant ALPHANUMERIC => [ 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z ];
use constant GEONAMETRIPLE => [ ZERO,MELOM,GEIER,OOSTBURG,COLOA,OMACHI,NORRI,LUMAI,KOUMA,IMONO,MCOJE,GADIN,ANGIA,IMATA,BASET,JARPLUND,CAIUA,LWOWEK,GUIPA,OWKAK,ABED,DONGGUAN,PASSE,KAPESTAN,MALSFELD,TABAAN,KITHOR,CAMPANET,ULALA,CAILA,TOMKI,THMEI,ZIHAR...
sub new {
my $class = shift;
my $self = {
};
bless ($self, $class);
view all matches for this distribution
view release on metacpan or search on metacpan
t/000-report-versions.t view on Meta::CPAN
return $self->_error("Did not provide a string to load");
}
# Byte order marks
# NOTE: Keeping this here to educate maintainers
# my %BOM = (
# "\357\273\277" => 'UTF-8',
# "\376\377" => 'UTF-16BE',
# "\377\376" => 'UTF-16LE',
# "\377\376\0\0" => 'UTF-32LE'
# "\0\0\376\377" => 'UTF-32BE',
# );
if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
return $self->_error("Stream has a non UTF-8 BOM");
} else {
# Strip UTF-8 bom if found, we'll just ignore it
$string =~ s/^\357\273\277//;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/basictest.data view on Meta::CPAN
12903 +44.685411 -73.447398 PLATTSBURGH NY
12910 +44.865209 -73.577683 ALTONA NY
12911 +44.528081 -73.471946 KEESEVILLE NY
12912 +44.711326 -73.648386 AU SABLE FORKS NY
12913 +44.401213 -74.070277 BLOOMINGDALE NY
12914 +44.674942 -74.444789 BOMBAY NY
12916 +44.877630 -74.489379 BRUSHTON NY
12917 +44.932057 -74.200948 BURKE NY
12918 +44.686162 -73.670249 CADYVILLE NY
12919 +44.726056 -73.578285 CHAMPLAIN NY
12920 +44.932727 -74.068371 CHATEAUGAY NY
view all matches for this distribution
view release on metacpan or search on metacpan
t/000-report-versions.t view on Meta::CPAN
return $self->_error("Did not provide a string to load");
}
# Byte order marks
# NOTE: Keeping this here to educate maintainers
# my %BOM = (
# "\357\273\277" => 'UTF-8',
# "\376\377" => 'UTF-16BE',
# "\377\376" => 'UTF-16LE',
# "\377\376\0\0" => 'UTF-32LE'
# "\0\0\376\377" => 'UTF-32BE',
# );
if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
return $self->_error("Stream has a non UTF-8 BOM");
} else {
# Strip UTF-8 bom if found, we'll just ignore it
$string =~ s/^\357\273\277//;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/000-report-versions.t view on Meta::CPAN
return $self->_error("Did not provide a string to load");
}
# Byte order marks
# NOTE: Keeping this here to educate maintainers
# my %BOM = (
# "\357\273\277" => 'UTF-8',
# "\376\377" => 'UTF-16BE',
# "\377\376" => 'UTF-16LE',
# "\377\376\0\0" => 'UTF-32LE'
# "\0\0\376\377" => 'UTF-32BE',
# );
if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
return $self->_error("Stream has a non UTF-8 BOM");
} else {
# Strip UTF-8 bom if found, we'll just ignore it
$string =~ s/^\357\273\277//;
}
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
PPI::Structure::Unknown 1.274
PPI::Structure::When 1.274
PPI::Token 1.274
PPI::Token::ArrayIndex 1.274
PPI::Token::Attribute 1.274
PPI::Token::BOM 1.274
PPI::Token::Cast 1.274
PPI::Token::Comment 1.274
PPI::Token::DashedWord 1.274
PPI::Token::Data 1.274
PPI::Token::End 1.274
view all matches for this distribution
view release on metacpan or search on metacpan
deps/libgit2/src/libgit2/attr_file.c view on Meta::CPAN
}
if ((error = git_attr_file__new(&file, entry, source)) < 0)
goto cleanup;
/* advance over a UTF8 BOM */
content_str = git_str_cstr(&content);
bom_offset = git_str_detect_bom(&bom, &content);
if (bom == GIT_STR_BOM_UTF8)
content_str += bom_offset;
/* store the key of the attr_reader; don't bother with cache
* invalidation during the same attr reader session.
*/
view all matches for this distribution
view release on metacpan or search on metacpan
test/key.1.asc view on Meta::CPAN
mQGiBDic/2URBACI/KqlvNzVIITUYUP0TtFxWjOXlGQRWN4DqiCSr9MXTj3KLLff
Ldxv7ffDYg9ai9rQZxPmFT+HSN12y5cwXzDLqPiAHbR/rBHu1yX1VnLLm9rWKReK
Z3y7CJs+iuDZqa13QWl6NfKGjGLSVnCZSpLYEEgBc9wkJj7qDxA6Q8C2SwCgjyo4
QscP8XZgy7eMePyT9TSrmhcEAIPjSMKqZfVt6E6P3ObaewmRscdeyMpEb6hYaaQz
UJB7/za+USOF6OfglVeLshOMBOMYSVhzIYKG3iuMhvNupnATVDSWeseY66KFgfcJ
8Ma2lutRLT5WHjgaBuS1I5vMZVAV+akmx05LhZsm6tYE8gilVlEadqQO3NnDjmvY
LMy0BACA3gTIXjDJ1iwT+Qz/knqEpaWdCQCzUz1NYZP++MXa75/4p9X3ayRPvBdk
T1DVJOCxnNOktfwteNrso/5Y+hwaZObHuWxO5hgXNUMWOnLvlU39WT6ENCaZCW6c
p2V4rB3j2JO8zQv0cM72Jfr4FqD1A+91wYxhc+NchnWvkZ5XBLQqR251UEcgdGVz
dCBrZXkgKGZvciB0ZXN0aW5nIHB1cnBvc2VzIG9ubHkpiFwEExECABwFAjic/2UF
view all matches for this distribution
view release on metacpan or search on metacpan
src/ppport.h view on Meta::CPAN
BOL_t8_p8|5.033003||Viu
BOL_t8_pb|5.033003||Viu
BOL_tb|5.035004||Viu
BOL_tb_p8|5.033003||Viu
BOL_tb_pb|5.033003||Viu
BOM_UTF8|5.025005|5.003007|p
BOM_UTF8_FIRST_BYTE|5.019004||Viu
BOM_UTF8_TAIL|5.019004||Viu
boolSV|5.004000|5.003007|p
boot_core_builtin|5.035007||Viu
boot_core_mro|5.009005||Viu
boot_core_PerlIO|5.007002||Viu
boot_core_UNIVERSAL|5.003007||Viu
src/ppport.h view on Meta::CPAN
#endif
#endif
#if 'A' == 65
#ifndef BOM_UTF8
# define BOM_UTF8 "\xEF\xBB\xBF"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xEF\xBF\xBD"
#endif
#elif '^' == 95
#ifndef BOM_UTF8
# define BOM_UTF8 "\xDD\x73\x66\x73"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x73\x73\x71"
#endif
#elif '^' == 176
#ifndef BOM_UTF8
# define BOM_UTF8 "\xDD\x72\x65\x72"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x72\x72\x70"
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
t/language-lexer.t view on Meta::CPAN
} or diag explain $@;
dies_ok { parse("\x{0007}") };
like $@->message, qr/Parse document failed for some reason/, 'invalid char';
lives_ok { parse("\x{FEFF} query foo { id }") } 'accepts BOM';
dies_ok { parse("\n\n ? \n\n\n") };
is_deeply [ map $@->locations->[0]->{$_}, qw(line column) ], [3,5], 'error respects whitespace';
$got = parse(string_make(' x '));
view all matches for this distribution
view release on metacpan or search on metacpan
t/000-report-versions.t view on Meta::CPAN
return $self->_error("Did not provide a string to load");
}
# Byte order marks
# NOTE: Keeping this here to educate maintainers
# my %BOM = (
# "\357\273\277" => 'UTF-8',
# "\376\377" => 'UTF-16BE',
# "\377\376" => 'UTF-16LE',
# "\377\376\0\0" => 'UTF-32LE'
# "\0\0\376\377" => 'UTF-32BE',
# );
if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
return $self->_error("Stream has a non UTF-8 BOM");
} else {
# Strip UTF-8 bom if found, we'll just ignore it
$string =~ s/^\357\273\277//;
}
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
PPI::Structure::Unknown 1.220
PPI::Structure::When 1.220
PPI::Token 1.220
PPI::Token::ArrayIndex 1.220
PPI::Token::Attribute 1.220
PPI::Token::BOM 1.220
PPI::Token::Cast 1.220
PPI::Token::Comment 1.220
PPI::Token::DashedWord 1.220
PPI::Token::Data 1.220
PPI::Token::End 1.220
view all matches for this distribution
view release on metacpan or search on metacpan
BmFLAGS|5.009005||Viu
BmPREVIOUS|5.003007||Viu
BmRARE|5.003007||Viu
BmUSEFUL|5.003007||Viu
BOL|5.003007||Viu
BOM_UTF8|5.025005|5.003007|p
BOM_UTF8_FIRST_BYTE|5.019004||Viu
BOM_UTF8_TAIL|5.019004||Viu
bool|5.003007||Viu
boolSV|5.004000|5.003007|p
boot_core_mro|5.009005||Viu
boot_core_PerlIO|5.007002||Viu
boot_core_UNIVERSAL|5.003007||Viu
#endif
#endif
#if 'A' == 65
#ifndef BOM_UTF8
# define BOM_UTF8 "\xEF\xBB\xBF"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xEF\xBF\xBD"
#endif
#elif '^' == 95
#ifndef BOM_UTF8
# define BOM_UTF8 "\xDD\x73\x66\x73"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x73\x73\x71"
#endif
#elif '^' == 176
#ifndef BOM_UTF8
# define BOM_UTF8 "\xDD\x72\x65\x72"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x72\x72\x70"
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
BmFLAGS|5.009005||Viu
BmPREVIOUS|5.003007||Viu
BmRARE|5.003007||Viu
BmUSEFUL|5.003007||Viu
BOL|5.003007||Viu
BOM_UTF8|5.025005|5.003007|p
BOM_UTF8_FIRST_BYTE|5.019004||Viu
BOM_UTF8_TAIL|5.019004||Viu
bool|5.003007||Viu
boolSV|5.004000|5.003007|p
boot_core_mro|5.009005||Viu
boot_core_PerlIO|5.007002||Viu
boot_core_UNIVERSAL|5.003007||Viu
#endif
#endif
#if 'A' == 65
#ifndef BOM_UTF8
# define BOM_UTF8 "\xEF\xBB\xBF"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xEF\xBF\xBD"
#endif
#elif '^' == 95
#ifndef BOM_UTF8
# define BOM_UTF8 "\xDD\x73\x66\x73"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x73\x73\x71"
#endif
#elif '^' == 176
#ifndef BOM_UTF8
# define BOM_UTF8 "\xDD\x72\x65\x72"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x72\x72\x70"
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
bind_match|5.003007||Viu
block_end|5.004000|5.004000|
block_gimme|5.004000|5.004000|u
blockhook_register|5.013003|5.013003|x
block_start|5.004000|5.004000|
BOM_UTF8|5.025005|5.003007|p
boolSV|5.004000|5.003007|p
boot_core_mro|5.009005||Viu
boot_core_PerlIO|5.007002||Viu
boot_core_UNIVERSAL|5.003007||Viu
_byte_dump_string|5.025006||cViu
#endif
#endif
#if 'A' == 65
#ifndef BOM_UTF8
# define BOM_UTF8 "\xEF\xBB\xBF"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xEF\xBF\xBD"
#endif
#elif '^' == 95
#ifndef BOM_UTF8
# define BOM_UTF8 "\xDD\x73\x66\x73"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x73\x73\x71"
#endif
#elif '^' == 176
#ifndef BOM_UTF8
# define BOM_UTF8 "\xDD\x72\x65\x72"
#endif
#ifndef REPLACEMENT_CHARACTER_UTF8
# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x72\x72\x70"
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
inc/YAML/Tiny.pm view on Meta::CPAN
die \"Did not provide a string to load";
}
# Byte order marks
# NOTE: Keeping this here to educate maintainers
# my %BOM = (
# "\357\273\277" => 'UTF-8',
# "\376\377" => 'UTF-16BE',
# "\377\376" => 'UTF-16LE',
# "\377\376\0\0" => 'UTF-32LE'
# "\0\0\376\377" => 'UTF-32BE',
# );
if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
die \"Stream has a non UTF-8 BOM";
} else {
# Strip UTF-8 bom if found, we'll just ignore it
$string =~ s/^\357\273\277//;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/YAML/Tiny.pm view on Meta::CPAN
die \"Did not provide a string to load";
}
# Byte order marks
# NOTE: Keeping this here to educate maintainers
# my %BOM = (
# "\357\273\277" => 'UTF-8',
# "\376\377" => 'UTF-16BE',
# "\377\376" => 'UTF-16LE',
# "\377\376\0\0" => 'UTF-32LE'
# "\0\0\376\377" => 'UTF-32BE',
# );
if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
die \"Stream has a non UTF-8 BOM";
} else {
# Strip UTF-8 bom if found, we'll just ignore it
$string =~ s/^\357\273\277//;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Encapsulate.pm view on Meta::CPAN
my ($words) = HTTP::Headers::Util::split_header_words($content_type);
my %param = @$words;
return $param{charset};
}
# 3) If there's a UTF BOM set, look for it
my $count = 0;
while (my ($enc, $bom) = $boms->[$count++, $count++])
{
return $enc
if $bom eq substr($chunk, 0, length $bom);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Encoding.pm view on Meta::CPAN
# remember match length
$resu{$e} = length $bom if $text =~ /^(\Q$bom\E)/;
}
# does not start with BOM
return unless keys %resu;
# sort by match length, longest match first
my @sort = sort { $resu{$b} <=> $resu{$a} } keys %resu;
lib/HTML/Encoding.pm view on Meta::CPAN
return unless defined $text;
return unless length $text;
my @boms = encoding_from_byte_order_mark($text, encodings => $encodings);
# BOM determines encoding
return wantarray ? (bom => \@boms) : $boms[0] if @boms;
# no BOM
my @decls = xml_declaration_from_octets($text, encodings => $encodings);
foreach my $decl (@decls)
{
my $enco = encoding_from_xml_declaration($decl);
$resu{$enco}++ if defined $enco and length $enco;
lib/HTML/Encoding.pm view on Meta::CPAN
}
else
{
my @boms = encoding_from_byte_order_mark($text, encodings => $encodings);
# BOM determines encoding
return wantarray ? (bom => \@boms) : $boms[0] if @boms;
}
# no BOM
my @resu;
# sanity check to exclude e.g. UTF-32
my @first = encoding_from_first_chars($text, encodings => $encodings);
lib/HTML/Encoding.pm view on Meta::CPAN
of $options{encodings} or the list of default encodings if no
encodings are specified and match the beginning of the string against
any byte order mark octet sequence found.
The result can be ambiguous, for example qq(\xFF\xFE\x00\x00) could
be both, a complete BOM in UTF-32LE or a UTF-16LE BOM followed by a
U+0000 character. It is also possible that C<$octets> starts with
something that looks like a byte order mark but actually is not.
encoding_from_byte_order_mark sorts the list of possible encodings
by the length of their BOM octet sequence and returns in scalar
context only the encoding with the longest match, and all encodings
ordered by length of their BOM octet sequence in list context.
Examples:
+-------------------------+------------+-----------------------+
| Input | Encodings | Result |
lib/HTML/Encoding.pm view on Meta::CPAN
This might change in future versions, although this is not very
relevant for most applications as there should never be need to use
UTF-7 in the encoding list for existing documents.
If no BOM can be found it returns C<undef> in scalar context and an
empty list in list context. This routine should not be used with
strings with the UTF-8 flag turned on.
=item encoding_from_xml_declaration($declaration)
view all matches for this distribution
view release on metacpan or search on metacpan
t/test_case_data/indymedia_feature.html view on Meta::CPAN
</div>
<p class="commenttext">*LE 15 FEVRIER 2010, PLUS DE 800 ACTIVISTES, DONT HUIT BOMSPOTTEURS BLOQUAIENT <br/>L'USINE ANGLAISE DE PRODUCTION DE BOMBES NUCLEAIRES* <br/>*voir_la_video* <br/><br/>*Plus de 800 activistes de toute lâEurope ont fermé l...
</div>
<div class="commentsbody">
<h3 class="commenttitle">Video of action at military base Volkel, the Netherlands</h3>
<p class="commentspost">
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/FormBuilder/Select.pm view on Meta::CPAN
our $VERSION = '0.13'; ## VERSION
=head1 NAME
HTML::FormBuilder::Select - Select Element Handling for BOM Forms
=cut
=head1 Synopsis
view all matches for this distribution
view release on metacpan or search on metacpan
devel/run.pl view on Meta::CPAN
my $str = HTML::FormatText::Elinks->format_file
('devel/base.html', base => 'http://localhost');
exit 0;
}
{
# BOM on input
# lynx recognises automatically
my $html = "<html><body><p>Hello world</p></body></html>\n";
require Encode;
$html = Encode::encode('utf-32',$html); # with BOM
# $html = "\xFF\xFE\x00\x00" . Encode::encode('utf-32le',$html); # with BOM
$html = ("\x20\x00\x00\x00" x 8) . $html; # BE spaces
print "HTML input string:\n";
IPC::Run::run(['hd'],'<',\$html, '>','/tmp/hd.txt');
IPC::Run::run(['cat'],'<','/tmp/hd.txt');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/Gumbo.pm view on Meta::CPAN
Use it to hardcode a specific encoding.
$gumbo->parse( $octets, input_is => 'octets', encoding => 'latin-1' );
=item BOM
UTF-8/UTF-16 BOMs are checked.
=item C<encoding_content_type> argument
Encdoning from rransport layer, charset in content-type header.
view all matches for this distribution
view release on metacpan or search on metacpan
inc/YAML/Tiny.pm view on Meta::CPAN
return $self->_error("Did not provide a string to load");
}
# Byte order marks
# NOTE: Keeping this here to educate maintainers
# my %BOM = (
# "\357\273\277" => 'UTF-8',
# "\376\377" => 'UTF-16BE',
# "\377\376" => 'UTF-16LE',
# "\377\376\0\0" => 'UTF-32LE'
# "\0\0\376\377" => 'UTF-32BE',
# );
if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
return $self->_error("Stream has a non UTF-8 BOM");
} else {
# Strip UTF-8 bom if found, we'll just ignore it
$string =~ s/^\357\273\277//;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/YAML/Tiny.pm view on Meta::CPAN
return $self->_error("Did not provide a string to load");
}
# Byte order marks
# NOTE: Keeping this here to educate maintainers
# my %BOM = (
# "\357\273\277" => 'UTF-8',
# "\376\377" => 'UTF-16BE',
# "\377\376" => 'UTF-16LE',
# "\377\376\0\0" => 'UTF-32LE'
# "\0\0\376\377" => 'UTF-32BE',
# );
if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
return $self->_error("Stream has a non UTF-8 BOM");
} else {
# Strip UTF-8 bom if found, we'll just ignore it
$string =~ s/^\357\273\277//;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/YAML/Tiny.pm view on Meta::CPAN
return $self->_error("Did not provide a string to load");
}
# Byte order marks
# NOTE: Keeping this here to educate maintainers
# my %BOM = (
# "\357\273\277" => 'UTF-8',
# "\376\377" => 'UTF-16BE',
# "\377\376" => 'UTF-16LE',
# "\377\376\0\0" => 'UTF-32LE'
# "\0\0\376\377" => 'UTF-32BE',
# );
if ( $string =~ /^(?:\376\377|\377\376|\377\376\0\0|\0\0\376\377)/ ) {
return $self->_error("Stream has a non UTF-8 BOM");
} else {
# Strip UTF-8 bom if found, we'll just ignore it
$string =~ s/^\357\273\277//;
}
view all matches for this distribution