blib/lib/HTML/HTML5/Parser/Charset/DecodeHandle.pm

filter: Statementstmt 22.8% 143 / 625 Branchbran 10.2% 36 / 350 Conditioncond 0.5% 1 / 170 MC/DCmcdc 0.0% 0 / 82 Subroutinesub 30.3% 10 / 33 Podpod 0.0% 0 / 3 totaltotal 15.0% 190 / 1263 CC 234 SCAR 90.4
CC
234
Cov
16%
create_decode_handle
16758.5
read
720.3
getc
702.0
CRAP 8452.3
« blib/lib/HTML/HTML5/Parser/Tokenizer.pm ↑ Summary blib/lib/HTML/HTML5/Parser/TagSoupParser.pm »
1 package HTML::HTML5::Parser::Charset::DecodeHandle;
2 ## skip Test::Tabs
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 9 our $VERSION = '0.991';
7  
8 ## NOTE: |Message::Charset::Info| uses this module without calling
9 ## the constructor.
10 9 ▶use HTML::HTML5::Parser::Charset::Info;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 9 my $XML_AUTO_CHARSET = q<http://suika.fam.cx/www/2006/03/xml-entity/>;
13 9 my $IANA_CHARSET = q<urn:x-suika-fam-cx:charset:>;
14 9 my $PERL_CHARSET = q<http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.>;
15 9 my $XML_CHARSET = q<http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.>;
16  
17 ## ->create_decode_handle ($charset_uri, $byte_stream, $onerror)
18 sub create_decode_handle ($$$;$) {
19 0 ▶ my $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$_[1]};
Subroutine create_decode_handle: not called CC=131 SCAR=97.3
Pod undocumented
20 my $obj = {
21 category => 0,
22 char_buffer => \(my $s = ''),
23 char_buffer_pos => 0,
24 character_queue => [],
25 filehandle => $_[2],
26 charset => $_[1],
27 byte_buffer => '',
28 ▶ onerror => $_[3] || sub {},
Subroutine __ANON__: not called CC=1 SCAR=0.0
29 #onerror_set
30 0 ▶ };
Condition0%0/3
$_[3] || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$_[3] || sub { }
$_[3] sub { }
Truth table0%0/3
A || B
A= $_[3]B= sub { }
ABresult
1X1
011
000
31 0 ▶ if ($csdef->{uri}->{$XML_AUTO_CHARSET} or
Branch: 3 branches
BranchTrueFalseTotal
if ($csdef->{'uri'}{$XML_AUTO_CHARSET} or $obj->{'charset'} eq $XML_AUTO_CHARSET) { } 0 0 0
elsif ($csdef->{'uri'}{$XML_CHARSET . 'utf-8'}) { } 0 0 0
elsif ($csdef->{'uri'}{$XML_CHARSET . 'utf-16'}) { } 0 0 0
Condition0%0/3
$csdef->{"uri"}{$XML_AUTO_CHARSET} or $obj->{"charset"} eq $XML_AUTO_CHARSET
l!l&&r!l&&!r
000
MC/DC0%0/2
$csdef->{"uri"}{$XML_AUTO_CHARSET} or $obj->{"charset"} eq $XML_AUTO_CHARSET
$csdef->{"uri"}{$XML_AUTO_CHARSET} $obj->{"charset"} eq $XML_AUTO_CHARSET
Truth table0%0/3
A or B
A= $csdef->{"uri"}{$XML_AUTO_CHARSET}B= $obj->{"charset"} eq $XML_AUTO_CHARSET
ABresult
1X1
011
000
32 $obj->{charset} eq $XML_AUTO_CHARSET) {
33 0 my $b = ''; # UTF-8 w/o BOM
34 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
35 0 $obj->{input_encoding} = 'UTF-8';
36 0 ▶ if (read $obj->{filehandle}, $b, 256) {
Branch: 1 branch
BranchTrueFalseTotal
if (read $obj->{"filehandle"}, $b, 256) 0 0 0
37 9 ▶ no warnings "substr";
Subroutine BEGIN: called CC=1 SCAR=0.0
38 9 ▶ no warnings "uninitialized";
Subroutine BEGIN: called CC=1 SCAR=0.0
39 0 ▶ if (substr ($b, 0, 1) eq "<") {
Branch: 6 branches
BranchTrueFalseTotal
if (substr($b, 0, 1) eq '<') { } 0 0 0
elsif (substr($b, 0, 3) eq "\357\273\277") { } 0 0 0
elsif (substr($b, 0, 2) eq "\000<") { } 0 0 0
elsif (substr($b, 0, 2) eq "\376\377") { } 0 0 0
elsif (substr($b, 0, 2) eq "\377\376") { } 0 0 0
elsif (substr($b, 0, 2) eq "\000\000") { } 0 0 0
40 0 ▶ if (substr ($b, 1, 1) eq "?") { # ASCII8
Branch: 2 branches
BranchTrueFalseTotal
if (substr($b, 1, 1) eq '?') { } 0 0 0
elsif (substr($b, 1, 1) eq "\000") { } 0 0 0
41 0 ▶ if ($b =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($b =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
42 encoding\s*=\s*["']([^"']*)/x) {
43 0 $obj->{input_encoding} = $1;
44 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
45 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
46 0 ▶ if (not $csdef->{ascii8} or $csdef->{bom_required}) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii8"} or $csdef->{"bom_required"}) 0 0 0
Condition0%0/3
not $csdef->{"ascii8"} or $csdef->{"bom_required"}
l!l&&r!l&&!r
000
MC/DC0%0/2
not $csdef->{"ascii8"} or $csdef->{"bom_required"}
not $csdef->{"ascii8"} $csdef->{"bom_required"}
Truth table0%0/3
not(A) or B
A= not $csdef->{"ascii8"}B= $csdef->{"bom_required"}
ABresult
1X1
011
000
47 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
48 charset_uri => $uri,
49 0 charset_name => $obj->{input_encoding});
50 }
51 } else {
52 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
53 0 $obj->{input_encoding} = 'UTF-8';
54 }
55 0 ▶ if (defined $csdef->{no_bom_variant}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant"}) 0 0 0
56 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant}};
57 }
58 } elsif (substr ($b, 1, 1) eq "\x00") {
59 0 ▶ if (substr ($b, 2, 2) eq "?\x00") { # ASCII16LE
Branch: 2 branches
BranchTrueFalseTotal
if (substr($b, 2, 2) eq "?\000") { } 0 0 0
elsif (substr($b, 2, 2) eq "\000\000") { } 0 0 0
60 0 my $c = $b; $c =~ tr/\x00//d;
61 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
62 encoding\s*=\s*["']([^"']*)/x) {
63 0 $obj->{input_encoding} = $1;
64 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
65 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
66 0 ▶ if (not $csdef->{ascii16} or $csdef->{ascii16be} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii16"} or $csdef->{"ascii16be"} or $csdef->{"bom_required"}) 0 0 0
Condition0%0/6
not $csdef->{"ascii16"} or $csdef->{"ascii16be"} or $csdef->{"bom_required"}
l!l&&r!l&&!r
000
not $csdef->{"ascii16"} or $csdef->{"ascii16be"}
l!l&&r!l&&!r
000
MC/DC0%0/3
not $csdef->{"ascii16"} or $csdef->{"ascii16be"} or $csdef->{"bom_required"}
not $csdef->{"ascii16"} $csdef->{"ascii16be"} $csdef->{"bom_required"}
Truth table0%0/4
not(A) or B or C
A= not $csdef->{"ascii16"}B= $csdef->{"ascii16be"}C= $csdef->{"bom_required"}
ABCresult
1XX1
01X1
0011
0000
67 $csdef->{bom_required}) {
68 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
69 charset_uri => $uri,
70 0 charset_name => $obj->{input_encoding});
71 }
72 } else {
73 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
74 0 $obj->{input_encoding} = 'UTF-8';
75 }
76 0 ▶ if (defined $csdef->{no_bom_variant16le}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant16le"}) 0 0 0
77 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant16le}};
78 }
79 } elsif (substr ($b, 2, 2) eq "\x00\x00") { # ASCII32Endian4321
80 0 my $c = $b; $c =~ tr/\x00//d;
81 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
82 encoding\s*=\s*["']([^"']*)/x) {
83 0 $obj->{input_encoding} = $1;
84 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
85 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
86 0 ▶ if (not $csdef->{ascii32} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"bom_required"}) 0 0 0
Condition0%0/12
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"bom_required"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"}
l!l&&r!l&&!r
000
MC/DC0%0/5
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"bom_required"}
not $csdef->{"ascii32"} $csdef->{"ascii32endian1234"} $csdef->{"ascii32endian2143"} $csdef->{"ascii32endian3412"} $csdef->{"bom_required"}
Truth table0%0/6
not(A) or B or C or D or E
A= not $csdef->{"ascii32"}B= $csdef->{"ascii32endian1234"}C= $csdef->{"ascii32endian2143"}D= $csdef->{"ascii32endian3412"}E= $csdef->{"bom_required"}
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
87 $csdef->{ascii32endian1234} or
88 $csdef->{ascii32endian2143} or
89 $csdef->{ascii32endian3412} or
90 $csdef->{bom_required}) {
91 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
92 charset_uri => $uri,
93 0 charset_name => $obj->{input_encoding});
94 }
95 } else {
96 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
97 0 $obj->{input_encoding} = 'UTF-8';
98 }
99 0 ▶ if (defined $csdef->{no_bom_variant32endian4321}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant32endian4321"}) 0 0 0
100 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant32endian4321}};
101 }
102 }
103 }
104 } elsif (substr ($b, 0, 3) eq "\xEF\xBB\xBF") { # UTF8
105 0 $obj->{has_bom} = 1;
106 0 substr ($b, 0, 3) = '';
107 0 my $c = $b;
108 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
109 encoding\s*=\s*["']([^"']*)/x) {
110 0 $obj->{input_encoding} = $1;
111 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
112 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
113 0 ▶ if (not $csdef->{utf8_encoding_scheme} or
Branch: 1 branch
BranchTrueFalseTotal
unless ($csdef->{"utf8_encoding_scheme"} and $csdef->{"bom_allowed"}) 0 0 0
Condition0%0/3
$csdef->{"utf8_encoding_scheme"} and $csdef->{"bom_allowed"}
!ll&&!rl&&r
000
MC/DC0%0/2
$csdef->{"utf8_encoding_scheme"} and $csdef->{"bom_allowed"}
$csdef->{"utf8_encoding_scheme"} $csdef->{"bom_allowed"}
Truth table0%0/3
A and B
A= $csdef->{"utf8_encoding_scheme"}B= $csdef->{"bom_allowed"}
ABresult
0X0
100
111
114 not $csdef->{bom_allowed}) {
115 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
116 charset_uri => $uri,
117 0 charset_name => $obj->{input_encoding});
118 }
119 } else {
120 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
121 0 $obj->{input_encoding} = 'UTF-8';
122 }
123 0 ▶ if (defined $csdef->{no_bom_variant}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant"}) 0 0 0
124 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant}};
125 }
126 } elsif (substr ($b, 0, 2) eq "\x00<") {
127 0 ▶ if (substr ($b, 2, 2) eq "\x00?") { # ASCII16BE
Branch: 2 branches
BranchTrueFalseTotal
if (substr($b, 2, 2) eq "\000?") { } 0 0 0
elsif (substr($b, 2, 2) eq "\000\000") { } 0 0 0
128 0 my $c = $b; $c =~ tr/\x00//d;
129 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
130 encoding\s*=\s*["']([^"']*)/x) {
131 0 $obj->{input_encoding} = $1;
132 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
133 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
134 0 ▶ if (not $csdef->{ascii16} or $csdef->{ascii16le} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii16"} or $csdef->{"ascii16le"} or $csdef->{"bom_required"}) 0 0 0
Condition0%0/6
not $csdef->{"ascii16"} or $csdef->{"ascii16le"} or $csdef->{"bom_required"}
l!l&&r!l&&!r
000
not $csdef->{"ascii16"} or $csdef->{"ascii16le"}
l!l&&r!l&&!r
000
MC/DC0%0/3
not $csdef->{"ascii16"} or $csdef->{"ascii16le"} or $csdef->{"bom_required"}
not $csdef->{"ascii16"} $csdef->{"ascii16le"} $csdef->{"bom_required"}
Truth table0%0/4
not(A) or B or C
A= not $csdef->{"ascii16"}B= $csdef->{"ascii16le"}C= $csdef->{"bom_required"}
ABCresult
1XX1
01X1
0011
0000
135 $csdef->{bom_required}) {
136 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
137 charset_uri => $uri,
138 0 charset_name => $obj->{input_encoding});
139 }
140 } else {
141 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
142 0 $obj->{input_encoding} = 'UTF-8';
143 }
144 0 ▶ if (defined $csdef->{no_bom_variant16be}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant16be"}) 0 0 0
145 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant16be}};
146 }
147 } elsif (substr ($b, 2, 2) eq "\x00\x00") { # ASCII32Endian3412
148 0 my $c = $b; $c =~ tr/\x00//d;
149 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
150 encoding\s*=\s*["']([^"']*)/x) {
151 0 $obj->{input_encoding} = $1;
152 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
153 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
154 0 ▶ if (not $csdef->{ascii32} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}) 0 0 0
Condition0%0/12
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian4321"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"}
l!l&&r!l&&!r
000
MC/DC0%0/5
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
not $csdef->{"ascii32"} $csdef->{"ascii32endian1234"} $csdef->{"ascii32endian2143"} $csdef->{"ascii32endian4321"} $csdef->{"bom_required"}
Truth table0%0/6
not(A) or B or C or D or E
A= not $csdef->{"ascii32"}B= $csdef->{"ascii32endian1234"}C= $csdef->{"ascii32endian2143"}D= $csdef->{"ascii32endian4321"}E= $csdef->{"bom_required"}
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
155 $csdef->{ascii32endian1234} or
156 $csdef->{ascii32endian2143} or
157 $csdef->{ascii32endian4321} or
158 $csdef->{bom_required}) {
159 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
160 charset_uri => $uri,
161 0 charset_name => $obj->{input_encoding});
162 }
163 } else {
164 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
165 0 $obj->{input_encoding} = 'UTF-8';
166 }
167 0 ▶ if (defined $csdef->{no_bom_variant32endian3412}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant32endian3412"}) 0 0 0
168 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant32endian3412}};
169 }
170 }
171 } elsif (substr ($b, 0, 2) eq "\xFE\xFF") {
172 0 ▶ if (substr ($b, 2, 2) eq "\x00<") { # ASCII16BE
Branch: 2 branches
BranchTrueFalseTotal
if (substr($b, 2, 2) eq "\000<") { } 0 0 0
elsif (substr($b, 2, 2) eq "\000\000") { } 0 0 0
173 0 $obj->{has_bom} = 1;
174 0 substr ($b, 0, 2) = '';
175 0 my $c = $b; $c =~ tr/\x00//d;
176 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
177 encoding\s*=\s*["']([^"']*)/x) {
178 0 $obj->{input_encoding} = $1;
179 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
180 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
181 0 ▶ if (not $csdef->{ascii16} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii16"} or $csdef->{"ascii16le"} or not $csdef->{"bom_allowed"}) 0 0 0
Condition0%0/6
not $csdef->{"ascii16"} or $csdef->{"ascii16le"} or not $csdef->{"bom_allowed"}
l!l&&r!l&&!r
000
not $csdef->{"ascii16"} or $csdef->{"ascii16le"}
l!l&&r!l&&!r
000
MC/DC0%0/3
not $csdef->{"ascii16"} or $csdef->{"ascii16le"} or not $csdef->{"bom_allowed"}
not $csdef->{"ascii16"} $csdef->{"ascii16le"} not $csdef->{"bom_allowed"}
Truth table0%0/4
not(A) or B or not(C)
A= not $csdef->{"ascii16"}B= $csdef->{"ascii16le"}C= not $csdef->{"bom_allowed"}
ABCresult
1XX1
01X1
0011
0000
182 $csdef->{ascii16le} or
183 not $csdef->{bom_allowed}) {
184 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
185 charset_uri => $uri,
186 0 charset_name => $obj->{input_encoding});
187 }
188 } else {
189 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16be'};
190 0 $obj->{input_encoding} = 'UTF-16';
191 }
192 0 ▶ if (defined $csdef->{no_bom_variant16be}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant16be"}) 0 0 0
193 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant16be}};
194 }
195 } elsif (substr ($b, 2, 2) eq "\x00\x00") { # ASCII32Endian3412
196 0 $obj->{has_bom} = 1;
197 0 substr ($b, 0, 4) = '';
198 0 my $c = $b; $c =~ tr/\x00//d;
199 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
200 encoding\s*=\s*["']([^"']*)/x) {
201 0 $obj->{input_encoding} = $1;
202 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
203 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
204 0 ▶ if (not $csdef->{ascii32} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian4321"} or not $csdef->{"bom_allowed"}) 0 0 0
Condition0%0/12
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian4321"} or not $csdef->{"bom_allowed"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian4321"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"}
l!l&&r!l&&!r
000
MC/DC0%0/5
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian4321"} or not $csdef->{"bom_allowed"}
not $csdef->{"ascii32"} $csdef->{"ascii32endian1234"} $csdef->{"ascii32endian2143"} $csdef->{"ascii32endian4321"} not $csdef->{"bom_allowed"}
Truth table0%0/6
not(A) or B or C or D or not(E)
A= not $csdef->{"ascii32"}B= $csdef->{"ascii32endian1234"}C= $csdef->{"ascii32endian2143"}D= $csdef->{"ascii32endian4321"}E= not $csdef->{"bom_allowed"}
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
205 $csdef->{ascii32endian1234} or
206 $csdef->{ascii32endian2143} or
207 $csdef->{ascii32endian4321} or
208 not $csdef->{bom_allowed}) {
209 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
210 charset_uri => $uri,
211 0 charset_name => $obj->{input_encoding});
212 }
213 } else {
214 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16be'};
215 0 $obj->{input_encoding} = 'UTF-16';
216 0 $obj->{byte_buffer} .= "\x00\x00";
217 }
218 0 ▶ if (defined $csdef->{no_bom_variant32endian3412}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant32endian3412"}) 0 0 0
219 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant32endian3412}};
220 }
221 } else {
222 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16be'};
223 0 $obj->{input_encoding} = 'UTF-16';
224 0 substr ($b, 0, 2) = '';
225 0 $obj->{has_bom} = 1;
226 }
227 } elsif (substr ($b, 0, 2) eq "\xFF\xFE") {
228 0 ▶ if (substr ($b, 2, 2) eq "<\x00") { # ASCII16LE
Branch: 2 branches
BranchTrueFalseTotal
if (substr($b, 2, 2) eq "<\000") { } 0 0 0
elsif (substr($b, 2, 2) eq "\000\000") { } 0 0 0
229 0 $obj->{has_bom} = 1;
230 0 substr ($b, 0, 2) = '';
231 0 my $c = $b; $c =~ tr/\x00//d;
232 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
233 encoding\s*=\s*["']([^"']*)/x) {
234 0 $obj->{input_encoding} = $1;
235 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
236 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
237 0 ▶ if (not $csdef->{ascii16} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii16"} or $csdef->{"ascii16be"} or not $csdef->{"bom_allowed"}) 0 0 0
Condition0%0/6
not $csdef->{"ascii16"} or $csdef->{"ascii16be"} or not $csdef->{"bom_allowed"}
l!l&&r!l&&!r
000
not $csdef->{"ascii16"} or $csdef->{"ascii16be"}
l!l&&r!l&&!r
000
MC/DC0%0/3
not $csdef->{"ascii16"} or $csdef->{"ascii16be"} or not $csdef->{"bom_allowed"}
not $csdef->{"ascii16"} $csdef->{"ascii16be"} not $csdef->{"bom_allowed"}
Truth table0%0/4
not(A) or B or not(C)
A= not $csdef->{"ascii16"}B= $csdef->{"ascii16be"}C= not $csdef->{"bom_allowed"}
ABCresult
1XX1
01X1
0011
0000
238 $csdef->{ascii16be} or
239 not $csdef->{bom_allowed}) {
240 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
241 charset_uri => $uri,
242 0 charset_name => $obj->{input_encoding});
243 }
244 } else {
245 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16le'};
246 0 $obj->{input_encoding} = 'UTF-16';
247 }
248 0 ▶ if (defined $csdef->{no_bom_variant16le}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant16le"}) 0 0 0
249 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant16le}};
250 }
251 } elsif (substr ($b, 2, 2) eq "\x00\x00") { # ASCII32Endian4321
252 0 $obj->{has_bom} = 1;
253 0 substr ($b, 0, 4) = '';
254 0 my $c = $b; $c =~ tr/\x00//d;
255 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
256 encoding\s*=\s*["']([^"']*)/x) {
257 0 $obj->{input_encoding} = $1;
258 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
259 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
260 0 ▶ if (not $csdef->{ascii32} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or not $csdef->{"bom_allowed"}) 0 0 0
Condition0%0/12
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or not $csdef->{"bom_allowed"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"}
l!l&&r!l&&!r
000
MC/DC0%0/5
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or not $csdef->{"bom_allowed"}
not $csdef->{"ascii32"} $csdef->{"ascii32endian1234"} $csdef->{"ascii32endian2143"} $csdef->{"ascii32endian3412"} not $csdef->{"bom_allowed"}
Truth table0%0/6
not(A) or B or C or D or not(E)
A= not $csdef->{"ascii32"}B= $csdef->{"ascii32endian1234"}C= $csdef->{"ascii32endian2143"}D= $csdef->{"ascii32endian3412"}E= not $csdef->{"bom_allowed"}
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
261 $csdef->{ascii32endian1234} or
262 $csdef->{ascii32endian2143} or
263 $csdef->{ascii32endian3412} or
264 not $csdef->{bom_allowed}) {
265 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
266 charset_uri => $uri,
267 0 charset_name => $obj->{input_encoding});
268 }
269 } else {
270 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16le'};
271 0 $obj->{input_encoding} = 'UTF-16';
272 0 $obj->{byte_buffer} .= "\x00\x00";
273 }
274 0 ▶ if (defined $csdef->{no_bom_variant32endian4321}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant32endian4321"}) 0 0 0
275 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant32endian4321}};
276 }
277 } else {
278 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16le'};
279 0 $obj->{input_encoding} = 'UTF-16';
280 0 substr ($b, 0, 2) = '';
281 0 $obj->{has_bom} = 1;
282 }
283 } elsif (substr ($b, 0, 2) eq "\x00\x00") {
284 0 ▶ if (substr ($b, 2, 2) eq "\x00<") { # ASCII32Endian1234
Branch: 4 branches
BranchTrueFalseTotal
if (substr($b, 2, 2) eq "\000<") { } 0 0 0
elsif (substr($b, 2, 2) eq "<\000") { } 0 0 0
elsif (substr($b, 2, 2) eq "\376\377") { } 0 0 0
elsif (substr($b, 2, 2) eq "\377\376") { } 0 0 0
285 0 my $c = $b; $c =~ tr/\x00//d;
286 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
287 encoding\s*=\s*["']([^"']*)/x) {
288 0 $obj->{input_encoding} = $1;
289 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
290 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
291 0 ▶ if (not $csdef->{ascii32} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}) 0 0 0
Condition0%0/12
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"}
l!l&&r!l&&!r
000
MC/DC0%0/5
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
not $csdef->{"ascii32"} $csdef->{"ascii32endian2143"} $csdef->{"ascii32endian3412"} $csdef->{"ascii32endian4321"} $csdef->{"bom_required"}
Truth table0%0/6
not(A) or B or C or D or E
A= not $csdef->{"ascii32"}B= $csdef->{"ascii32endian2143"}C= $csdef->{"ascii32endian3412"}D= $csdef->{"ascii32endian4321"}E= $csdef->{"bom_required"}
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
292 $csdef->{ascii32endian2143} or
293 $csdef->{ascii32endian3412} or
294 $csdef->{ascii32endian4321} or
295 $csdef->{bom_required}) {
296 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
297 charset_uri => $uri,
298 0 charset_name => $obj->{input_encoding});
299 }
300 } else {
301 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
302 0 $obj->{input_encoding} = 'UTF-8';
303 }
304 0 ▶ if (defined $csdef->{no_bom_variant32endian1234}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant32endian1234"}) 0 0 0
305 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant32endian1234}};
306 }
307 } elsif (substr ($b, 2, 2) eq "<\x00") { # ASCII32Endian2143
308 0 my $c = $b; $c =~ tr/\x00//d;
309 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
310 encoding\s*=\s*["']([^"']*)/x) {
311 0 $obj->{input_encoding} = $1;
312 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
313 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
314 0 ▶ if (not $csdef->{ascii32} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}) 0 0 0
Condition0%0/12
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"}
l!l&&r!l&&!r
000
MC/DC0%0/5
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
not $csdef->{"ascii32"} $csdef->{"ascii32endian1234"} $csdef->{"ascii32endian3412"} $csdef->{"ascii32endian4321"} $csdef->{"bom_required"}
Truth table0%0/6
not(A) or B or C or D or E
A= not $csdef->{"ascii32"}B= $csdef->{"ascii32endian1234"}C= $csdef->{"ascii32endian3412"}D= $csdef->{"ascii32endian4321"}E= $csdef->{"bom_required"}
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
315 $csdef->{ascii32endian1234} or
316 $csdef->{ascii32endian3412} or
317 $csdef->{ascii32endian4321} or
318 $csdef->{bom_required}) {
319 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
320 charset_uri => $uri,
321 0 charset_name => $obj->{input_encoding});
322 }
323 } else {
324 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
325 0 $obj->{input_encoding} = 'UTF-8';
326 }
327 0 ▶ if (defined $csdef->{no_bom_variant32endian2143}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant32endian2143"}) 0 0 0
328 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant32endian2143}};
329 }
330 } elsif (substr ($b, 2, 2) eq "\xFE\xFF") { # ASCII32Endian1234
331 0 $obj->{has_bom} = 1;
332 0 substr ($b, 0, 4) = '';
333 0 my $c = $b; $c =~ tr/\x00//d;
334 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
335 encoding\s*=\s*["']([^"']*)/x) {
336 0 $obj->{input_encoding} = $1;
337 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
338 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
339 0 ▶ if (not $csdef->{ascii32} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}) 0 0 0
Condition0%0/12
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"}
l!l&&r!l&&!r
000
MC/DC0%0/5
not $csdef->{"ascii32"} or $csdef->{"ascii32endian2143"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
not $csdef->{"ascii32"} $csdef->{"ascii32endian2143"} $csdef->{"ascii32endian3412"} $csdef->{"ascii32endian4321"} $csdef->{"bom_required"}
Truth table0%0/6
not(A) or B or C or D or E
A= not $csdef->{"ascii32"}B= $csdef->{"ascii32endian2143"}C= $csdef->{"ascii32endian3412"}D= $csdef->{"ascii32endian4321"}E= $csdef->{"bom_required"}
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
340 $csdef->{ascii32endian2143} or
341 $csdef->{ascii32endian3412} or
342 $csdef->{ascii32endian4321} or
343 $csdef->{bom_required}) {
344 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
345 charset_uri => $uri,
346 0 charset_name => $obj->{input_encoding});
347 }
348 } else {
349 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
350 0 $obj->{input_encoding} = 'UTF-8';
351 0 $obj->{has_bom} = 0;
352 0 $obj->{byte_buffer} .= "\x00\x00\xFE\xFF";
353 }
354 0 ▶ if (defined $csdef->{no_bom_variant32endian1234}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant32endian1234"}) 0 0 0
355 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant32endian1234}};
356 }
357 } elsif (substr ($b, 2, 2) eq "\xFF\xFE") { # ASCII32Endian2143
358 0 $obj->{has_bom} = 1;
359 0 substr ($b, 0, 4) = '';
360 0 my $c = $b; $c =~ tr/\x00//d;
361 0 ▶ if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)?
Branch: 1 branch
BranchTrueFalseTotal
if ($c =~ /^<\?xml\s+(?:version\s*=\s*["'][^"']*["']\s*)? encoding\s*=\s*["']([^"']*)/x) { } 0 0 0
362 encoding\s*=\s*["']([^"']*)/x) {
363 0 $obj->{input_encoding} = $1;
364 0 my $uri = name_to_uri (undef, 'xml', $obj->{input_encoding});
365 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
366 0 ▶ if (not $csdef->{ascii32} or
Branch: 1 branch
BranchTrueFalseTotal
if (not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}) 0 0 0
Condition0%0/12
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"}
l!l&&r!l&&!r
000
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"}
l!l&&r!l&&!r
000
MC/DC0%0/5
not $csdef->{"ascii32"} or $csdef->{"ascii32endian1234"} or $csdef->{"ascii32endian3412"} or $csdef->{"ascii32endian4321"} or $csdef->{"bom_required"}
not $csdef->{"ascii32"} $csdef->{"ascii32endian1234"} $csdef->{"ascii32endian3412"} $csdef->{"ascii32endian4321"} $csdef->{"bom_required"}
Truth table0%0/6
not(A) or B or C or D or E
A= not $csdef->{"ascii32"}B= $csdef->{"ascii32endian1234"}C= $csdef->{"ascii32endian3412"}D= $csdef->{"ascii32endian4321"}E= $csdef->{"bom_required"}
ABCDEresult
1XXXX1
01XXX1
001XX1
0001X1
000011
000000
367 $csdef->{ascii32endian1234} or
368 $csdef->{ascii32endian3412} or
369 $csdef->{ascii32endian4321} or
370 $csdef->{bom_required}) {
371 $obj->{onerror}->(undef, 'charset-name-mismatch-error',
372 charset_uri => $uri,
373 0 charset_name => $obj->{input_encoding});
374 }
375 } else {
376 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'};
377 0 $obj->{input_encoding} = 'UTF-8';
378 0 $obj->{has_bom} = 0;
379 0 $obj->{byte_buffer} .= "\x00\x00\xFF\xFE";
380 }
381 0 ▶ if (defined $csdef->{no_bom_variant32endian2143}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $csdef->{"no_bom_variant32endian2143"}) 0 0 0
382 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$csdef->{no_bom_variant32endian2143}};
383 }
384 }
385 # \x4C\x6F\xA7\x94 EBCDIC
386 } # buffer
387 0 $obj->{byte_buffer} .= $b;
388 } # read
389 } elsif ($csdef->{uri}->{$XML_CHARSET.'utf-8'}) {
390 ## BOM is optional.
391 0 my $b = '';
392 0 ▶ if (read $obj->{filehandle}, $b, 3) {
Branch: 1 branch
BranchTrueFalseTotal
if (read $obj->{"filehandle"}, $b, 3) 0 0 0
393 0 ▶ if ($b eq "\xEF\xBB\xBF") {
Branch: 1 branch
BranchTrueFalseTotal
if ($b eq "\357\273\277") { } 0 0 0
394 0 $obj->{has_bom} = 1;
395 } else {
396 0 $obj->{byte_buffer} .= $b;
397 }
398 }
399 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-8'}; # UTF-8 w/o BOM
400 } elsif ($csdef->{uri}->{$XML_CHARSET.'utf-16'}) {
401 ## BOM is mandated.
402 0 my $b = '';
403 0 ▶ if (read $obj->{filehandle}, $b, 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (read $obj->{'filehandle'}, $b, 2) { } 0 0 0
404 0 ▶ if ($b eq "\xFE\xFF") {
Branch: 2 branches
BranchTrueFalseTotal
if ($b eq "\376\377") { } 0 0 0
elsif ($b eq "\377\376") { } 0 0 0
405 0 $obj->{has_bom} = 1; # UTF-16BE w/o BOM
406 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16be'};
407 } elsif ($b eq "\xFF\xFE") {
408 0 $obj->{has_bom} = 1; # UTF-16LE w/o BOM
409 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16le'};
410 } else {
411 0 $obj->{onerror}->(undef, 'no-bom-error', charset_uri => $obj->{charset});
412 0 $obj->{has_bom} = 0;
413 0 $obj->{byte_buffer} .= $b; # UTF-16BE w/o BOM
414 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16be'};
415 }
416 } else {
417 0 $obj->{onerror}->(undef, 'no-bom-error', charset_uri => $obj->{charset});
418 0 $obj->{has_bom} = 0; # UTF-16BE w/o BOM
419 0 $csdef = $HTML::HTML5::Parser::Charset::CharsetDef->{$PERL_CHARSET.'utf-16be'};
420 }
421 }
422  
423 0 ▶ if ($csdef->{uri}->{$XML_CHARSET.'iso-2022-jp'}) {
Branch: 3 branches
BranchTrueFalseTotal
if ($csdef->{'uri'}{$XML_CHARSET . 'iso-2022-jp'}) { } 0 0 0
elsif ($csdef->{'uri'}{$IANA_CHARSET . 'iso-2022-jp'}) { } 0 0 0
elsif (defined $csdef->{'perl_name'}[0]) { } 0 0 0
424 0 $obj->{state_2440} = 'gl-jis-1997-swapped';
425 0 $obj->{state_2442} = 'gl-jis-1997';
426 0 $obj->{state} = 'state_2842';
427 0 require Encode::GLJIS1997Swapped;
428 0 require Encode::GLJIS1997;
429 0 ▶ if (Encode::find_encoding ($obj->{state_2440}) and
Branch: 1 branch
BranchTrueFalseTotal
if (&Encode::find_encoding($obj->{"state_2440"}) and &Encode::find_encoding($obj->{"state_2442"})) 0 0 0
Condition0%0/3
&Encode::find_encoding($obj->{"state_2440"}) and &Encode::find_encoding($obj->{"state_2442"})
!ll&&!rl&&r
000
MC/DC0%0/2
&Encode::find_encoding($obj->{"state_2440"}) and &Encode::find_encoding($obj->{"state_2442"})
&Encode::find_encoding($obj->{"state_2440"}) &Encode::find_encoding($obj->{"state_2442"})
Truth table0%0/3
A and B
A= &Encode::find_encoding($obj->{"state_2440"})B= &Encode::find_encoding($obj->{"state_2442"})
ABresult
0X0
100
111
430 Encode::find_encoding ($obj->{state_2442})) {
431 0 return bless $obj, 'HTML::HTML5::Parser::Charset::DecodeHandle::ISO2022JP';
432 }
433 } elsif ($csdef->{uri}->{$IANA_CHARSET.'iso-2022-jp'}) {
434 0 $obj->{state_2440} = 'gl-jis-1978';
435 0 $obj->{state_2442} = 'gl-jis-1983';
436 0 $obj->{state} = 'state_2842';
437 0 require Encode::GLJIS1978;
438 0 require Encode::GLJIS1983;
439 0 ▶ if (Encode::find_encoding ($obj->{state_2440}) and
Branch: 1 branch
BranchTrueFalseTotal
if (&Encode::find_encoding($obj->{"state_2440"}) and &Encode::find_encoding($obj->{"state_2442"})) 0 0 0
Condition0%0/3
&Encode::find_encoding($obj->{"state_2440"}) and &Encode::find_encoding($obj->{"state_2442"})
!ll&&!rl&&r
000
MC/DC0%0/2
&Encode::find_encoding($obj->{"state_2440"}) and &Encode::find_encoding($obj->{"state_2442"})
&Encode::find_encoding($obj->{"state_2440"}) &Encode::find_encoding($obj->{"state_2442"})
Truth table0%0/3
A and B
A= &Encode::find_encoding($obj->{"state_2440"})B= &Encode::find_encoding($obj->{"state_2442"})
ABresult
0X0
100
111
440 Encode::find_encoding ($obj->{state_2442})) {
441 0 return bless $obj, 'HTML::HTML5::Parser::Charset::DecodeHandle::ISO2022JP';
442 }
443 } elsif (defined $csdef->{perl_name}->[0]) {
444 0 ▶ if ($csdef->{uri}->{$XML_CHARSET.'euc-jp'} or
Branch: 3 branches
BranchTrueFalseTotal
if ($csdef->{'uri'}{$XML_CHARSET . 'euc-jp'} or $csdef->{'uri'}{$IANA_CHARSET . 'euc-jp'}) { } 0 0 0
elsif ($csdef->{'uri'}{$XML_CHARSET . 'shift_jis'} or $csdef->{'uri'}{$IANA_CHARSET . 'shift_jis'}) { } 0 0 0
elsif ($csdef->{'is_block_safe'}) { } 0 0 0
Condition0%0/3
$csdef->{"uri"}{$XML_CHARSET . 'euc-jp'} or $csdef->{"uri"}{$IANA_CHARSET . 'euc-jp'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$csdef->{"uri"}{$XML_CHARSET . 'euc-jp'} or $csdef->{"uri"}{$IANA_CHARSET . 'euc-jp'}
$csdef->{"uri"}{$XML_CHARSET . 'euc-jp'} $csdef->{"uri"}{$IANA_CHARSET . 'euc-jp'}
Truth table0%0/3
A or B
A= $csdef->{"uri"}{$XML_CHARSET . 'euc-jp'}B= $csdef->{"uri"}{$IANA_CHARSET . 'euc-jp'}
ABresult
1X1
011
000
445 $csdef->{uri}->{$IANA_CHARSET.'euc-jp'}) {
446 0 $obj->{perl_encoding_name} = $csdef->{perl_name}->[0];
447 0 require Encode::EUCJP1997;
448 0 ▶ if (Encode::find_encoding ($obj->{perl_encoding_name})) {
Branch: 1 branch
BranchTrueFalseTotal
if (&Encode::find_encoding($obj->{"perl_encoding_name"})) 0 0 0
449 0 $obj->{category} |= HTML::HTML5::Parser::Charset::Info::CHARSET_CATEGORY_EUCJP;
450 0 return bless $obj, 'HTML::HTML5::Parser::Charset::DecodeHandle::Encode';
451 }
452 ▶ } elsif ($csdef->{uri}->{$XML_CHARSET.'shift_jis'} or
Condition0%0/3
$csdef->{"uri"}{$XML_CHARSET . 'shift_jis'} or $csdef->{"uri"}{$IANA_CHARSET . 'shift_jis'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$csdef->{"uri"}{$XML_CHARSET . 'shift_jis'} or $csdef->{"uri"}{$IANA_CHARSET . 'shift_jis'}
$csdef->{"uri"}{$XML_CHARSET . 'shift_jis'} $csdef->{"uri"}{$IANA_CHARSET . 'shift_jis'}
Truth table0%0/3
A or B
A= $csdef->{"uri"}{$XML_CHARSET . 'shift_jis'}B= $csdef->{"uri"}{$IANA_CHARSET . 'shift_jis'}
ABresult
1X1
011
000
453 $csdef->{uri}->{$IANA_CHARSET.'shift_jis'}) {
454 0 $obj->{perl_encoding_name} = $csdef->{perl_name}->[0];
455 0 require Encode::ShiftJIS1997;
456 0 ▶ if (Encode::find_encoding ($obj->{perl_encoding_name})) {
Branch: 1 branch
BranchTrueFalseTotal
if (&Encode::find_encoding($obj->{"perl_encoding_name"})) 0 0 0
457 0 return bless $obj, 'HTML::HTML5::Parser::Charset::DecodeHandle::Encode';
458 }
459 } elsif ($csdef->{is_block_safe}) {
460 0 $obj->{perl_encoding_name} = $csdef->{perl_name}->[0];
461 0 require Encode;
462 0 ▶ if (Encode::find_encoding ($obj->{perl_encoding_name})) {
Branch: 1 branch
BranchTrueFalseTotal
if (&Encode::find_encoding($obj->{"perl_encoding_name"})) 0 0 0
463 0 return bless $obj, 'HTML::HTML5::Parser::Charset::DecodeHandle::Encode';
464 }
465 }
466 }
467
468 $obj->{onerror}->(undef, 'charset-not-supported-error',
469 0 charset_uri => $obj->{charset});
470 0 return undef;
471 } # create_decode_handle
472  
473 sub name_to_uri ($$$) {
474 0 ▶ my $domain = $_[1];
Subroutine name_to_uri: not called CC=5 SCAR=34.0
Pod undocumented
475 0 my $name = lc $_[2];
476  
477 0 ▶ if ($domain eq 'ietf') {
Branch: 2 branches
BranchTrueFalseTotal
if ($domain eq 'ietf') { } 0 0 0
elsif ($domain eq 'xml') { } 0 0 0
478 0 return $IANA_CHARSET . $name;
479 } elsif ($domain eq 'xml') {
480 0 ▶ if ({
Branch: 1 branch
BranchTrueFalseTotal
if ({"utf-8", 1, "utf-16", 1, "iso-10646-ucs-2", 1, "iso-10646-ucs-4", 1, "iso-8859-1", 1, "iso-8859-2", 1, "iso-8859-3", 1, "iso-8859-4", 1, "iso-8859-5", 1, "iso-8859-6", 1, "iso-8859-7", 1, "iso-8859-8", 1, "iso-8859-9", 1, "iso-8859-10", 1, "iso-8859-11", 1, "iso-8859-13", 1, "iso-8859-14", 1, "iso-8859-15", 1, "iso-8859-16", 1, "iso-2022-jp", 1, "shift_jis", 1, "euc-jp", 1}->{$name}) 0 0 0
481 'utf-8' => 1,
482 'utf-16' => 1,
483 'iso-10646-ucs-2' => 1,
484 'iso-10646-ucs-4' => 1,
485 'iso-8859-1' => 1,
486 'iso-8859-2' => 1,
487 'iso-8859-3' => 1,
488 'iso-8859-4' => 1,
489 'iso-8859-5' => 1,
490 'iso-8859-6' => 1,
491 'iso-8859-7' => 1,
492 'iso-8859-8' => 1,
493 'iso-8859-9' => 1,
494 'iso-8859-10' => 1,
495 'iso-8859-11' => 1,
496 'iso-8859-13' => 1,
497 'iso-8859-14' => 1,
498 'iso-8859-15' => 1,
499 'iso-8859-16' => 1,
500 'iso-2022-jp' => 1,
501 'shift_jis' => 1,
502 'euc-jp' => 1,
503 }->{$name}) {
504 0 return $XML_CHARSET . $name;
505 }
506  
507 0 my $uri = $IANA_CHARSET . $name;
508 0 ▶ return $uri if $HTML::HTML5::Parser::Charset::CharsetDef->{$uri};
Branch: 1 branch
BranchTrueFalseTotal
if $HTML::HTML5::Parser::Charset::CharsetDef->{$uri} 0 0 0
509  
510 0 return $XML_CHARSET . $name;
511 } else {
512 0 return undef;
513 }
514 } # name_to_uri
515  
516 sub uri_to_name ($$$) {
517 0 ▶ my (undef, $domain, $uri) = @_;
Subroutine uri_to_name: not called CC=7 SCAR=40.3
Pod undocumented
518
519 0 ▶ if ($domain eq 'xml') {
Branch: 1 branch
BranchTrueFalseTotal
if ($domain eq "xml") 0 0 0
520 0 my $v = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri}->{xml_name};
521 0 ▶ return $v if defined $v;
Branch: 1 branch
BranchTrueFalseTotal
if defined $v 0 0 0
522  
523 0 ▶ if (substr ($uri, 0, length $XML_CHARSET) eq $XML_CHARSET) {
Branch: 1 branch
BranchTrueFalseTotal
if (substr($uri, 0, length $XML_CHARSET) eq $XML_CHARSET) 0 0 0
524 0 return substr ($uri, length $XML_CHARSET);
525 }
526  
527 0 $domain = 'ietf'; ## TODO: XML encoding name has smaller range
528 }
529  
530 0 ▶ if ($domain eq 'ietf') {
Branch: 1 branch
BranchTrueFalseTotal
if ($domain eq "ietf") 0 0 0
531 0 my $v = $HTML::HTML5::Parser::Charset::CharsetDef->{$uri}->{iana_name};
532 0 ▶ return $v->[0] if defined $v;
Branch: 1 branch
BranchTrueFalseTotal
if defined $v 0 0 0
533  
534 0 ▶ if (substr ($uri, 0, length $IANA_CHARSET) eq $IANA_CHARSET) {
Branch: 1 branch
BranchTrueFalseTotal
if (substr($uri, 0, length $IANA_CHARSET) eq $IANA_CHARSET) 0 0 0
535 0 return substr ($uri, length $IANA_CHARSET);
536 }
537 }
538  
539 0 return undef;
540 } # uri_to_name
541  
542 9 require IO::Handle;
543  
544 package HTML::HTML5::Parser::Charset::DecodeHandle::ByteBuffer;
545  
546 ## NOTE: Provides a byte buffer wrapper object.
547  
548 sub new ($$) {
549 708 ▶ my $self = bless {
Subroutine new: called CC=1 SCAR=0.0
550 buffer => '',
551 }, shift;
552 708 $self->{filehandle} = shift;
553 708 return $self;
554 } # new
555  
556 sub read {
557 2589 ▶ my $self = shift;
Subroutine read: called CC=1 SCAR=0.0
558 2589 my $pos = length $self->{buffer};
559 2589 my $r = $self->{filehandle}->read ($self->{buffer}, $_[1], $pos);
560 2589 substr ($_[0], $_[2]) = substr ($self->{buffer}, $pos);
561 ## NOTE: This would do different behavior from Perl's standard
562 ## |read| when $pos points beyond the end of the string.
563 2589 return $r;
564 } # read
565  
566 0 ▶sub close { $_[0]->{filehandle}->close }
Subroutine close: not called CC=1 SCAR=6.9
567  
568 package HTML::HTML5::Parser::Charset::DecodeHandle::CharString;
569  
570 ## NOTE: Same as Perl's standard |open $handle, '<', \$char_string|,
571 ## but supports |ungetc| and other extensions.
572  
573 sub new ($$) {
574 0 ▶ my $self = bless {pos => 0}, shift;
Subroutine new: not called CC=1 SCAR=6.9
575 0 $self->{string} = shift; # must be a scalar ref
576 0 return $self;
577 } # new
578  
579 sub getc ($) {
580 0 ▶ my $self = shift;
Subroutine getc: not called CC=2 SCAR=17.9
581 0 ▶ if ($self->{pos} < length ${$self->{string}}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'pos'} < length ${$self->{'string'};}) { } 0 0 0
582 0 return substr ${$self->{string}}, $self->{pos}++, 1;
583 } else {
584 0 return undef;
585 }
586 } # getc
587  
588 sub read ($$$$) {
589 #my ($self, $scalar, $length, $offset) = @_;
590 0 ▶ my $self = $_[0];
Subroutine read: not called CC=3 SCAR=24.8
591 0 ▶ my $length = $_[2] || 0;
Condition0%0/2
$_[2] || 0
l!l
00
MC/DC0%0/1
$_[2] || 0
$_[2]
Truth table0%0/2
A
A= $_[2]
Aresult
11
00
592 0 ▶ my $offset = $_[3] || 0;
Condition0%0/2
$_[3] || 0
l!l
00
MC/DC0%0/1
$_[3] || 0
$_[3]
Truth table0%0/2
A
A= $_[3]
Aresult
11
00
593 ## NOTE: We don't support standard Perl semantics if $offset is
594 ## greater than the length of $scalar.
595 0 substr ($_[1], $offset) = substr (${$self->{string}}, $self->{pos}, $length);
596 0 my $count = (length $_[1]) - $offset;
597 0 $self->{pos} += $count;
598 0 return $count;
599 } # read
600  
601 sub manakai_read_until ($$$;$) {
602 #my ($self, $scalar, $pattern, $offset) = @_;
603 0 ▶ my $self = $_[0];
Subroutine manakai_read_until: not called CC=2 SCAR=17.9
604 0 pos (${$self->{string}}) = $self->{pos};
605 0 ▶ if (${$self->{string}} =~ /\G(?>$_[2])+/) {
Branch: 1 branch
BranchTrueFalseTotal
if (${$self->{'string'};} =~ /\G(?>$_[2])+/) { } 0 0 0
606 0 substr ($_[1], $_[3]) = substr (${$self->{string}}, $-[0], $+[0] - $-[0]);
607 0 $self->{pos} += $+[0] - $-[0];
608 0 return $+[0] - $-[0];
609 } else {
610 0 return 0;
611 }
612 } # manakai_read_until
613  
614 sub ungetc ($$) {
615 0 ▶ my $self = shift;
Subroutine ungetc: not called CC=2 SCAR=17.9
616 ## Ignore second parameter.
617 0 ▶ $self->{pos}-- if $self->{pos} > 0;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"pos"} > 0 0 0 0
618 } # ungetc
619  
620 ▶sub close ($) { }
Subroutine close: not called CC=1 SCAR=0.0
621  
622 ▶sub onerror ($;$) { }
Subroutine onerror: not called CC=1 SCAR=0.0
623  
624 package HTML::HTML5::Parser::Charset::DecodeHandle::Encode;
625  
626 ## NOTE: Provides a Perl |Encode| module wrapper object.
627  
628 0 ▶sub charset ($) { $_[0]->{charset} }
Subroutine charset: not called CC=1 SCAR=6.9
629  
630 0 ▶sub close ($) { $_[0]->{filehandle}->close }
Subroutine close: not called CC=1 SCAR=6.9
631  
632 sub getc ($) {
633 0 ▶ my $c = '';
Subroutine getc: not called CC=2 SCAR=17.9
634 0 my $l = $_[0]->read ($c, 1);
635 0 ▶ if ($l) {
Branch: 1 branch
BranchTrueFalseTotal
if ($l) { } 0 0 0
636 0 return $c;
637 } else {
638 0 return undef;
639 }
640 } # getc
641  
642 sub read ($$$;$) {
643 2740 ▶ my $self = $_[0];
Subroutine read: called CC=47 SCAR=65.8
644 #my $scalar = $_[1];
645 2740 my $length = $_[2];
646 2740 ▶ my $offset = $_[3] || 0;
Condition50%1/2
$_[3] || 0
l!l
02740
MC/DC0%0/1
$_[3] || 0
$_[3]
Truth table50%1/2
A
A= $_[3]
Aresult
11
00
647 2740 my $count = 0;
648 2740 my $eof;
649 ## NOTE: It is incompatible with the standard Perl semantics
650 ## if $offset is greater than the length of $scalar.
651  
652 A: {
653 2740 ▶ return $count if $length < 1;
Branch: 1 branch
BranchTrueFalseTotal
if $length < 1 0 5340 5340
654  
655 5340 ▶ if (my $l = (length ${$self->{char_buffer}}) - $self->{char_buffer_pos}) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $l = length(${$self->{"char_buffer"};}) - $self->{"char_buffer_pos"}) 1227 4113 5340
656 1227 ▶ if ($l >= $length) {
Branch: 1 branch
BranchTrueFalseTotal
if ($l >= $length) { } 144 1083 1227
657 substr ($_[1], $offset)
658 144 = substr (${$self->{char_buffer}}, $self->{char_buffer_pos},
659 144 $length);
660 144 $count += $length;
661 144 $self->{char_buffer_pos} += $length;
662 144 $length = 0;
663 144 return $count;
664 } else {
665 substr ($_[1], $offset)
666 1083 = substr (${$self->{char_buffer}}, $self->{char_buffer_pos});
667 1083 $count += $l;
668 1083 $length -= $l;
669 1083 ${$self->{char_buffer}} = '';
670 1083 $self->{char_buffer_pos} = 0;
671 }
672 1083 $offset = length $_[1];
673 }
674  
675 5196 ▶ if ($eof) {
Branch: 1 branch
BranchTrueFalseTotal
if ($eof) 2596 2600 5196
676 2596 return $count;
677 }
678  
679 2600 my $error;
680 2600 ▶ if ($self->{continue}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'continue'}) { } 0 2600 2600
elsif (512 > length $self->{'byte_buffer'}) { } 2598 2 2600
681 0 ▶ if ($self->{filehandle}->read ($self->{byte_buffer}, 256,
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'filehandle'}->read($self->{'byte_buffer'}, 256, length $self->{'byte_buffer'})) { } 0 0 0
682 length $self->{byte_buffer})) {
683 #
684 } else {
685 0 $error = 1;
686 }
687 0 $self->{continue} = 0;
688 } elsif (512 > length $self->{byte_buffer}) {
689 2598 ▶ if ($self->{filehandle}->read ($self->{byte_buffer}, 256,
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'filehandle'}->read($self->{'byte_buffer'}, 256, length $self->{'byte_buffer'})) { } 0 2598 2598
690 length $self->{byte_buffer})) {
691 #
692 } else {
693 2598 $eof = 1;
694 }
695 }
696  
697 2600 ▶ unless ($error) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($error) 2600 0 2600
698 2600 ▶ if (not $self->{bom_checked}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"bom_checked"}) 711 1889 2600
699 711 ▶ if (defined $self->{bom_pattern}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{"bom_pattern"}) 709 2 711
700 709 ▶ if ($self->{byte_buffer} =~ s/^$self->{bom_pattern}//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"byte_buffer"} =~ s/^$self->{"bom_pattern"}//) 0 709 709
701 0 $self->{has_bom} = 1;
702 }
703 }
704 711 $self->{bom_checked} = 1;
705 }
706 2600 my $string = do {
707 2600 ▶ local $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /^Code point/ };
Subroutine __ANON__: not called CC=2 SCAR=13.0
Branch: 1 branch
BranchTrueFalseTotal
unless $_[0] =~ /^Code point/ 0 0 0
708 Encode::decode (
709 $self->{perl_encoding_name},
710 $self->{byte_buffer},
711 2600 Encode::FB_QUIET(),
712 );
713 };
714 2600 ▶ if (length $string) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $string) { } 711 1889 2600
715 711 $self->{char_buffer} = \$string;
716 711 $self->{char_buffer_pos} = 0;
717 711 ▶ if (length $self->{byte_buffer}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $self->{"byte_buffer"}) 0 711 711
718 0 $self->{continue} = 1;
719 }
720 } else {
721 1889 ▶ if (length $self->{byte_buffer}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $self->{'byte_buffer'}) { } 0 1889 1889
722 0 $error = 1;
723 } else {
724 ## NOTE: No further input.
725 1889 redo A;
726 }
727 }
728 }
729  
730 711 ▶ if ($error) {
Branch: 1 branch
BranchTrueFalseTotal
if ($error) 0 711 711
731 0 my $r = substr $self->{byte_buffer}, 0, 1, '';
732 0 my $fallback;
733 0 my $etype = 'illegal-octets-error';
734 0 my %earg;
735 0 ▶ if ($self->{category}
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'category'} & 4) { } 0 0 0
elsif ($self->{'category'} & 2) { } 0 0 0
736 & HTML::HTML5::Parser::Charset::Info::CHARSET_CATEGORY_SJIS) {
737 0 ▶ if ($r =~ /^[\x81-\x9F\xE0-\xFC]/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($r =~ /^[\x81-\x9F\xE0-\xFC]/) { } 0 0 0
elsif ($r =~ /^[\x80\xA0\xFD-\xFF]/) { } 0 0 0
738 0 ▶ if ($self->{byte_buffer} =~ s/(.)//s) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"byte_buffer"} =~ s/(.)//s) 0 0 0
739 0 $r .= $1; # not limited to \x40-\xFC - \x7F
740 0 $etype = 'unassigned-code-point-error';
741 }
742 ## NOTE: Range [\xF0-\xFC] is unassigned and may be used as a
743 ## single-byte character or as the first-byte of a double-byte
744 ## character, according to JIS X 0208:1997 Appendix 1. However, the
745 ## current practice is using the range as first-bytes of double-byte
746 ## characters.
747 } elsif ($r =~ /^[\x80\xA0\xFD-\xFF]/) {
748 0 $etype = 'unassigned-code-point-error';
749 }
750 } elsif ($self->{category}
751 & HTML::HTML5::Parser::Charset::Info::CHARSET_CATEGORY_EUCJP) {
752 0 ▶ if ($r =~ /^[\xA1-\xFE]/) {
Branch: 4 branches
BranchTrueFalseTotal
if ($r =~ /^[\xA1-\xFE]/) { } 0 0 0
elsif ($r eq "\217") { } 0 0 0
elsif ($r eq "\216") { } 0 0 0
elsif ($r eq "\240" or $r eq "\377") { } 0 0 0
753 0 ▶ if ($self->{byte_buffer} =~ s/^([\xA1-\xFE])//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"byte_buffer"} =~ s/^([\xA1-\xFE])//) 0 0 0
754 0 $r .= $1;
755 0 $etype = 'unassigned-code-point-error';
756 }
757 } elsif ($r eq "\x8F") {
758 0 ▶ if ($self->{byte_buffer} =~ s/^([\xA1-\xFE][\xA1-\xFE]?)//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"byte_buffer"} =~ s/^([\xA1-\xFE][\xA1-\xFE]?)//) 0 0 0
759 0 $r .= $1;
760 0 ▶ $etype = 'unassigned-code-point-error' if length $1 == 2;
Branch: 1 branch
BranchTrueFalseTotal
if length $1 == 2 0 0 0
761 }
762 } elsif ($r eq "\x8E") {
763 0 ▶ if ($self->{byte_buffer} =~ s/^([\xA1-\xFE])//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"byte_buffer"} =~ s/^([\xA1-\xFE])//) 0 0 0
764 0 $r .= $1;
765 0 $etype = 'unassigned-code-point-error';
766 }
767 ▶ } elsif ($r eq "\xA0" or $r eq "\xFF") {
Condition0%0/3
$r eq "\240" or $r eq "\377"
l!l&&r!l&&!r
000
MC/DC0%0/2
$r eq "\240" or $r eq "\377"
$r eq "\240" $r eq "\377"
Truth table0%0/3
A or B
A= $r eq "\240"B= $r eq "\377"
ABresult
1X1
011
000
768 0 $etype = 'unassigned-code-point-error';
769 }
770 } else {
771 0 $fallback = $self->{fallback}->{$r};
772 0 ▶ if (defined $fallback) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined $fallback) { } 0 0 0
elsif (exists $self->{'fallback'}{$r}) { } 0 0 0
773 ## NOTE: This is an HTML5 parse error.
774 0 $etype = 'fallback-char-error';
775 0 $earg{char} = \$fallback;
776 } elsif (exists $self->{fallback}->{$r}) {
777 ## NOTE: This is an HTML5 parse error. In addition, the octet
778 ## is not assigned with a character.
779 0 $etype = 'fallback-unassigned-error';
780 }
781 }
782  
783 ## NOTE: Fixup line/column number by counting the number of
784 ## lines/columns in the string that is to be retuend by this
785 ## method call.
786 0 my $line_diff = 0;
787 0 my $col_diff = 0;
788 0 my $set_col;
789 0 ▶ for (my $i = 0; $i < $count; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $count) 0 0 0
790 0 my $s = substr $_[1], $i - $count, 1;
791 0 ▶ if ($s eq "\x0D") {
Branch: 2 branches
BranchTrueFalseTotal
if ($s eq "\r") { } 0 0 0
elsif ($s eq "\n") { } 0 0 0
792 0 $line_diff++;
793 0 $col_diff = 0;
794 0 $set_col = 1;
795 0 ▶ $i++ if substr ($_[1], $i - $count + 1, 1) eq "\x0A";
Branch: 1 branch
BranchTrueFalseTotal
if substr($_[1], $i - $count + 1, 1) eq "\n" 0 0 0
796 } elsif ($s eq "\x0A") {
797 0 $line_diff++;
798 0 $col_diff = 0;
799 0 $set_col = 1;
800 } else {
801 0 $col_diff++;
802 }
803 }
804 0 my $i = $self->{char_buffer_pos};
805 0 ▶ if ($count and substr (${$self->{char_buffer}}, -1, 1) eq "\x0D") {
Branch: 1 branch
BranchTrueFalseTotal
if ($count and substr(${$self->{"char_buffer"};}, -1, 1) eq "\r") 0 0 0
Condition0%0/3
$count and substr(${$self->{"char_buffer"};}, -1, 1) eq "\r"
!ll&&!rl&&r
000
MC/DC0%0/2
$count and substr(${$self->{"char_buffer"};}, -1, 1) eq "\r"
$count substr(${$self->{"char_buffer"};}, -1, 1) eq "\r"
Truth table0%0/3
A and B
A= $countB= substr(${$self->{"char_buffer"};}, -1, 1) eq "\r"
ABresult
0X0
100
111
806 0 ▶ if (substr (${$self->{char_buffer}}, $i, 1) eq "\x0A") {
Branch: 1 branch
BranchTrueFalseTotal
if (substr(${$self->{"char_buffer"};}, $i, 1) eq "\n") 0 0 0
807 0 $i++;
808 }
809 }
810 0 my $cb_length = length ${$self->{char_buffer}};
811 0 ▶ for (; $i < $cb_length; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $cb_length) 0 0 0
812 0 my $s = substr $_[1], $i, 1;
813 0 ▶ if ($s eq "\x0D") {
Branch: 2 branches
BranchTrueFalseTotal
if ($s eq "\r") { } 0 0 0
elsif ($s eq "\n") { } 0 0 0
814 0 $line_diff++;
815 0 $col_diff = 0;
816 0 $set_col = 1;
817 0 ▶ $i++ if substr ($_[1], $i + 1, 1) eq "\x0A";
Branch: 1 branch
BranchTrueFalseTotal
if substr($_[1], $i + 1, 1) eq "\n" 0 0 0
818 } elsif ($s eq "\x0A") {
819 0 $line_diff++;
820 0 $col_diff = 0;
821 0 $set_col = 1;
822 } else {
823 0 $col_diff++;
824 }
825 }
826 $self->{onerror}->($self, $etype, octets => \$r, %earg,
827 0 ▶ level => $self->{level}->{$self->{error_level}->{$etype}},
Branch: 1 branch
BranchTrueFalseTotal
$set_col ? : 0 0 0
828 line_diff => $line_diff,
829 ($set_col ? (column => 1) : ()),
830 column_diff => $col_diff);
831 ## NOTE: Error handler may modify |octets| parameter, which
832 ## would be returned as part of the output. Note that what
833 ## is returned would affect what |manakai_read_until| returns.
834 0 ▶ ${$self->{char_buffer}} .= defined $fallback ? $fallback : $r;
Branch: 1 branch
BranchTrueFalseTotal
defined $fallback ? : 0 0 0
835 }
836  
837 711 redo A;
838 } # A
839 } # read
840  
841 sub manakai_read_until ($$$;$) {
842 #my ($self, $scalar, $pattern, $offset) = @_;
843 1894 ▶ my $self = $_[0];
Subroutine manakai_read_until: called CC=6 SCAR=17.9
844 1894 my $s = '';
845 1894 $self->read ($s, 255);
846 1894 ▶ if ($s =~ /^(?>$_[2])+/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($s =~ /^(?>$_[2])+/) { } 883 1011 1894
elsif (length $s) { } 209 802 1011
847 883 my $rem_length = (length $s) - $+[0];
848 883 ▶ if ($rem_length) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rem_length) 174 709 883
849 174 ▶ if ($self->{char_buffer_pos} > $rem_length) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'char_buffer_pos'} > $rem_length) { } 3 171 174
850 3 $self->{char_buffer_pos} -= $rem_length;
851 } else {
852 171 substr (${$self->{char_buffer}}, 0, $self->{char_buffer_pos})
853 171 = substr ($s, $+[0]);
854 171 $self->{char_buffer_pos} = 0;
855 }
856 }
857 883 substr ($_[1], $_[3]) = substr ($s, $-[0], $+[0] - $-[0]);
858 883 return $+[0];
859 } elsif (length $s) {
860 209 ▶ if ($self->{char_buffer_pos} > length $s) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'char_buffer_pos'} > length $s) { } 2 207 209
861 2 $self->{char_buffer_pos} -= length $s;
862 } else {
863 207 substr (${$self->{char_buffer}}, 0, $self->{char_buffer_pos}) = $s;
864 207 $self->{char_buffer_pos} = 0;
865 }
866 }
867 1011 return 0;
868 } # manakai_read_until
869  
870 0 ▶sub has_bom ($) { $_[0]->{has_bom} }
Subroutine has_bom: not called CC=1 SCAR=6.9
871  
872 sub input_encoding ($) {
873 0 ▶ my $v = $_[0]->{input_encoding};
Subroutine input_encoding: not called CC=3 SCAR=24.8
874 0 ▶ return $v if defined $v;
Branch: 1 branch
BranchTrueFalseTotal
if defined $v 0 0 0
875  
876 0 my $uri = $_[0]->{charset};
877 0 ▶ if (defined $uri) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $uri) 0 0 0
878 0 return HTML::HTML5::Parser::Charset::DecodeHandle->uri_to_name (xml => $uri);
879 }
880  
881 0 return undef;
882 } # input_encoding
883  
884 sub onerror ($;$) {
885 1422 ▶ if (@_ > 1) {
Subroutine onerror: called CC=4 SCAR=15.0
Branch: 1 branch
BranchTrueFalseTotal
if (@_ > 1) 711 711 1422
886 711 ▶ if ($_[1]) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_[1]) { } 711 0 711
887 711 $_[0]->{onerror} = $_[1];
888 711 $_[0]->{onerror_set} = 1;
889 } else {
890 0 ▶ $_[0]->{onerror} = sub { };
Subroutine __ANON__: not called CC=1 SCAR=6.9
891 0 delete $_[0]->{onerror_set};
892 }
893 }
894  
895 1422 ▶ return $_[0]->{onerror_set} ? $_[0]->{onerror} : undef;
Branch: 1 branch
BranchTrueFalseTotal
$_[0]{'onerror_set'} ? : 1422 0 1422
896 } # onerror
897  
898 sub ungetc ($$) {
899 0 ▶ unshift @{$_[0]->{character_queue}}, chr int ($_[1] or 0);
Subroutine ungetc: not called CC=2 SCAR=17.9
Condition0%0/2
$_[1] || 0
l!l
00
MC/DC0%0/1
$_[1] || 0
$_[1]
Truth table0%0/2
A
A= $_[1]
Aresult
11
00
900 } # ungetc
901  
902 package HTML::HTML5::Parser::Charset::DecodeHandle::ISO2022JP;
903 9 push our @ISA, 'HTML::HTML5::Parser::Charset::DecodeHandle::Encode';
904  
905 sub getc ($) {
906 0 ▶ my $self = $_[0];
Subroutine getc: not called CC=26 SCAR=65.5
907 0 ▶ return shift @{$self->{character_queue}} if @{$self->{character_queue}};
Branch: 1 branch
BranchTrueFalseTotal
if @{$self->{"character_queue"};} 0 0 0
908  
909 0 my $r;
910 A: {
911 0 my $error;
912 0 ▶ if ($self->{continue}) {
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'continue'}) { } 0 0 0
elsif (512 > length $self->{'byte_buffer'}) { } 0 0 0
913 0 ▶ if ($self->{filehandle}->read ($self->{byte_buffer}, 256,
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'filehandle'}->read($self->{'byte_buffer'}, 256, length $self->{'byte_buffer'})) { } 0 0 0
914 length $self->{byte_buffer})) {
915 #
916 } else {
917 0 $error = 1;
918 }
919 0 $self->{continue} = 0;
920 } elsif (512 > length $self->{byte_buffer}) {
921 $self->{filehandle}->read ($self->{byte_buffer}, 256,
922 0 length $self->{byte_buffer});
923 }
924
925 0 ▶ unless ($error) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($error) 0 0 0
926 0 ▶ if ($self->{byte_buffer} =~ s/^\x1B(\x24[\x40\x42]|\x28[\x42\x4A])//) {
Branch: 5 branches
BranchTrueFalseTotal
if ($self->{'byte_buffer'} =~ s/^\x1B(\x24[\x40\x42]|\x28[\x42\x4A])//) { } 0 0 0
elsif ($self->{'state'} eq 'state_2842') { } 0 0 0
elsif ($self->{'state'} eq 'state_284A') { } 0 0 0
elsif ($self->{'state'} eq 'state_2442') { } 0 0 0
elsif ($self->{'state'} eq 'state_2440') { } 0 0 0
927 $self->{state} = {
928 "\x24\x40" => 'state_2440',
929 "\x24\x42" => 'state_2442',
930 "\x28\x42" => 'state_2842',
931 "\x28\x4A" => 'state_284A',
932 0 }->{$1};
933 0 redo A;
934 } elsif ($self->{state} eq 'state_2842') { # IRV
935 0 ▶ if ($self->{byte_buffer} =~ s/^([\x00-\x0D\x10-\x1A\x1C-\x7F]+)//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'byte_buffer'} =~ s/^([\x00-\x0D\x10-\x1A\x1C-\x7F]+)//) { } 0 0 0
936 0 push @{$self->{character_queue}}, split //, $1;
937 0 $r = shift @{$self->{character_queue}};
938 } else {
939 0 ▶ if (length $self->{byte_buffer}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $self->{'byte_buffer'}) { } 0 0 0
940 0 $error = 1;
941 } else {
942 0 $r = undef;
943 }
944 }
945 } elsif ($self->{state} eq 'state_284A') { # 0201
946 0 ▶ if ($self->{byte_buffer} =~ s/^([\x00-\x0D\x10-\x1A\x1C-\x7F]+)//) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'byte_buffer'} =~ s/^([\x00-\x0D\x10-\x1A\x1C-\x7F]+)//) { } 0 0 0
947 0 my $v = $1;
948 0 $v =~ tr/\x5C\x7E/\xA5\x{203E}/;
949 0 push @{$self->{character_queue}}, split //, $v;
950 0 $r = shift @{$self->{character_queue}};
951 } else {
952 0 ▶ if (length $self->{byte_buffer}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $self->{'byte_buffer'}) { } 0 0 0
953 0 $error = 1;
954 } else {
955 0 $r = undef;
956 $self->{onerror}->($self, 'invalid-state-error',
957 state => $self->{state},
958 0 level => $self->{level}->{$self->{error_level}->{'invalid-state-error'}});
959 }
960 }
961 } elsif ($self->{state} eq 'state_2442') { # 1983
962 my $v = Encode::decode ($self->{state_2442},
963 $self->{byte_buffer},
964 0 Encode::FB_QUIET ());
965 0 ▶ if (length $v) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $v) { } 0 0 0
966 0 push @{$self->{character_queue}}, split //, $v;
967 0 $r = shift @{$self->{character_queue}};
968 } else {
969 0 ▶ if (length $self->{byte_buffer}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $self->{'byte_buffer'}) { } 0 0 0
970 0 $error = 1;
971 } else {
972 0 $r = undef;
973 $self->{onerror}->($self, 'invalid-state-error',
974 state => $self->{state},
975 0 level => $self->{level}->{$self->{error_level}->{'invalid-state-error'}});
976 }
977 }
978 } elsif ($self->{state} eq 'state_2440') { # 1978
979 my $v = Encode::decode ($self->{state_2440},
980 $self->{byte_buffer},
981 0 Encode::FB_QUIET ());
982 0 ▶ if (length $v) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $v) { } 0 0 0
983 0 push @{$self->{character_queue}}, split //, $v;
984 0 $r = shift @{$self->{character_queue}};
985 } else {
986 0 ▶ if (length $self->{byte_buffer}) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $self->{'byte_buffer'}) { } 0 0 0
987 0 $error = 1;
988 } else {
989 0 $r = undef;
990 $self->{onerror}->($self, 'invalid-state-error',
991 state => $self->{state},
992 0 level => $self->{level}->{$self->{error_level}->{'invalid-state-error'}});
993 }
994 }
995 } else {
996 0 $error = 1;
997 }
998 }
999
1000 0 ▶ if ($error) {
Branch: 1 branch
BranchTrueFalseTotal
if ($error) 0 0 0
1001 0 $r = substr $self->{byte_buffer}, 0, 1, '';
1002 0 my $etype = 'illegal-octets-error';
1003 0 ▶ if (($self->{state} eq 'state_2442' or
Branch: 2 branches
BranchTrueFalseTotal
if ($self->{'state'} eq 'state_2442' || $self->{'state'} eq 'state_2440' and $r =~ /^[\x21-\x7E]/ and $self->{'byte_buffer'} =~ s/^([\x21-\x7E])//) { } 0 0 0
elsif ($r eq "\e" and $self->{'byte_buffer'} =~ s/^\(H//) { } 0 0 0
Condition0%0/9
$self->{"state"} eq "state_2442" || $self->{"state"} eq "state_2440" and $r =~ /^[\x21-\x7E]/ and $self->{"byte_buffer"} =~ s/^([\x21-\x7E])//
!ll&&!rl&&r
000
$self->{"state"} eq "state_2442" || $self->{"state"} eq "state_2440" and $r =~ /^[\x21-\x7E]/
!ll&&!rl&&r
000
$self->{"state"} eq "state_2442" or $self->{"state"} eq "state_2440"
l!l&&r!l&&!r
000
MC/DC0%0/4
$self->{"state"} eq "state_2442" || $self->{"state"} eq "state_2440" and $r =~ /^[\x21-\x7E]/ and $self->{"byte_buffer"} =~ s/^([\x21-\x7E])//
$self->{"state"} eq "state_2442" $self->{"state"} eq "state_2440" $r =~ /^[\x21-\x7E]/ $self->{"byte_buffer"} =~ s/^([\x21-\x7E])//
Truth table0%0/7
A or B and C and D
A= $self->{"state"} eq "state_2442"B= $self->{"state"} eq "state_2440"C= $r =~ /^[\x21-\x7E]/D= $self->{"byte_buffer"} =~ s/^([\x21-\x7E])//
ABCDresult
00XX0
1X0X0
010X0
1X100
01100
1X111
01111
1004 $self->{state} eq 'state_2440') and
1005 $r =~ /^[\x21-\x7E]/ and
1006 $self->{byte_buffer} =~ s/^([\x21-\x7E])//) {
1007 0 $r .= $1;
1008 0 $etype = 'unassigned-code-point-error';
1009 ▶ } elsif ($r eq "\x1B" and
Condition0%0/3
$r eq "\e" and $self->{"byte_buffer"} =~ s/^\(H//
!ll&&!rl&&r
000
MC/DC0%0/2
$r eq "\e" and $self->{"byte_buffer"} =~ s/^\(H//
$r eq "\e" $self->{"byte_buffer"} =~ s/^\(H//
Truth table0%0/3
A and B
A= $r eq "\e"B= $self->{"byte_buffer"} =~ s/^\(H//
ABresult
0X0
100
111
1010 $self->{byte_buffer} =~ s/^\(H//) { # Old 0201
1011 0 $r .= "(H";
1012 0 $self->{state} = 'state_284A';
1013 }
1014 $self->{onerror}->($self, $etype, octets => \$r,
1015 0 level => $self->{level}->{$self->{error_level}->{$etype}});
1016 }
1017 } # A
1018
1019 0 return $r;
1020 } # getc
1021  
1022 ## TODO: This is not good for performance. Should be replaced
1023 ## by read-centric implementation.
1024 sub read ($$$;$) {
1025 #my ($self, $scalar, $length, $offset) = @_;
1026 0 ▶ my $length = $_[2];
Subroutine read: not called CC=3 SCAR=24.8
1027 0 my $r = '';
1028 0 ▶ while ($length > 0) {
Branch: 1 branch
BranchTrueFalseTotal
if ($length > 0) 0 0 0
1029 0 my $c = $_[0]->getc;
1030 0 ▶ last unless defined $c;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $c 0 0 0
1031 0 $r .= $c;
1032 0 $length--;
1033 }
1034 0 substr ($_[1], $_[3]) = $r;
1035 ## NOTE: This would do different thing from what Perl's |read| do
1036 ## if $offset points beyond the end of the $scalar.
1037 0 return length $r;
1038 } # read
1039  
1040 sub manakai_read_until ($$$;$) {
1041 #my ($self, $scalar, $pattern, $offset) = @_;
1042 0 ▶ my $self = $_[0];
Subroutine manakai_read_until: not called CC=3 SCAR=24.8
1043 0 my $c = $self->getc;
1044 0 ▶ if ($c =~ /^$_[2]/) {
Branch: 2 branches
BranchTrueFalseTotal
if ($c =~ /^$_[2]/) { } 0 0 0
elsif (defined $c) { } 0 0 0
1045 0 substr ($_[1], $_[3]) = $c;
1046 0 return 1;
1047 } elsif (defined $c) {
1048 0 $self->ungetc (ord $c);
1049 0 return 0;
1050 } else {
1051 0 return 0;
1052 }
1053 } # manakai_read_until
1054  
1055 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:us-ascii'} =
1056 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:us'} =
1057 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:iso646-us'} =
1058 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:cp367'} =
1059 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:ibm367'} =
1060 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:ansi_x3.4-1986'} =
1061 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:ansi_x3.4-1968'} =
1062 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:iso-ir-6'} =
1063 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:csascii'} =
1064 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:iso_646.irv:1991'} =
1065 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:ascii'} = {ascii8 =>
1066 '1',
1067 is_block_safe =>
1068 '1',
1069 ietf_name =>
1070 ['ansi_x3.4-1968',
1071 'ansi_x3.4-1986',
1072 'ascii',
1073 'cp367',
1074 'csascii',
1075 'ibm367',
1076 'iso-ir-6',
1077 'iso646-us',
1078 'iso_646.irv:1991',
1079 'us',
1080 'us-ascii',
1081 'us-ascii'],
1082 mime_name =>
1083 'us-ascii',
1084 perl_name =>
1085 ['ascii',
1086 'iso-646-us',
1087 'us-ascii'],
1088 utf8_encoding_scheme =>
1089 '1',
1090 'uri',
1091 {'urn:x-suika-fam-cx:charset:ansi_x3.4-1968',
1092 '1',
1093 'urn:x-suika-fam-cx:charset:ansi_x3.4-1986',
1094 '1',
1095 'urn:x-suika-fam-cx:charset:ascii',
1096 '1',
1097 'urn:x-suika-fam-cx:charset:cp367',
1098 '1',
1099 'urn:x-suika-fam-cx:charset:csascii',
1100 '1',
1101 'urn:x-suika-fam-cx:charset:ibm367',
1102 '1',
1103 'urn:x-suika-fam-cx:charset:iso-ir-6',
1104 '1',
1105 'urn:x-suika-fam-cx:charset:iso646-us',
1106 '1',
1107 'urn:x-suika-fam-cx:charset:iso_646.irv:1991',
1108 '1',
1109 'urn:x-suika-fam-cx:charset:us',
1110 '1',
1111 'urn:x-suika-fam-cx:charset:us-ascii',
1112 '1'},
1113 };
1114  
1115 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.ascii-ctrl'} = {perl_name =>
1116 ['ascii-ctrl'],
1117 'uri',
1118 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.ascii-ctrl',
1119 '1'}};
1120 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.null'} = {perl_name =>
1121 ['null'],
1122 'uri',
1123 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.null',
1124 '1'}};
1125 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.utf-8'} = {ascii8 =>
1126 '1',
1127 bom_allowed =>
1128 '1',
1129 no_bom_variant =>
1130 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf8',
1131 utf8_encoding_scheme =>
1132 '1',
1133 'uri',
1134 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.utf-8',
1135 '1'},
1136 xml_name => 'UTF-8',
1137 };
1138  
1139 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/UTF-8.RFC2279'} = {ascii8 =>
1140 '1',
1141 bom_allowed =>
1142 '1',
1143 no_bom_variant =>
1144 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf8',
1145 utf8_encoding_scheme =>
1146 '1',
1147 'uri',
1148 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/UTF-8.RFC2279',
1149 '1'}};
1150 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-8'} = {
1151 ascii8 => 1,
1152 is_block_safe =>
1153 '1',
1154 perl_name =>
1155 ['utf-8'],
1156 utf8_encoding_scheme =>
1157 '1',
1158 'uri',
1159 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-8',
1160 '1'}};
1161 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:utf-8'} = {
1162 ascii8 => 1,
1163 bom_allowed =>
1164 '1',
1165 no_bom_variant =>
1166 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-8',
1167 ietf_name =>
1168 ['utf-8'],
1169 mime_name =>
1170 'utf-8',
1171 utf8_encoding_scheme =>
1172 '1',
1173 'uri',
1174 {'urn:x-suika-fam-cx:charset:utf-8',
1175 '1'},
1176 };
1177  
1178 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf8'} = {ascii8 =>
1179 '1',
1180 is_block_safe =>
1181 '1',
1182 perl_name =>
1183 ['utf8'],
1184 utf8_encoding_scheme =>
1185 '1',
1186 'uri',
1187 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf8',
1188 '1'}};
1189 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.utf-16'} = {
1190 ascii16 => 1,
1191 bom_allowed =>
1192 '1',
1193 bom_required =>
1194 '1',
1195 no_bom_variant =>
1196 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16le',
1197 no_bom_variant16be =>
1198 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16be',
1199 no_bom_variant16le =>
1200 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16le',
1201 perl_name =>
1202 ['utf-16'],
1203 'uri',
1204 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.utf-16',
1205 '1'},
1206 xml_name => 'UTF-16',
1207 };
1208  
1209 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:utf-16'} = {
1210 ascii16 => 1,
1211 bom_allowed =>
1212 '1',
1213 no_bom_variant =>
1214 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16le',
1215 no_bom_variant16be =>
1216 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16be',
1217 no_bom_variant16le =>
1218 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16le',
1219 ietf_name =>
1220 ['utf-16'],
1221 mime_name =>
1222 'utf-16',
1223 'uri',
1224 {'urn:x-suika-fam-cx:charset:utf-16',
1225 '1'},
1226 };
1227  
1228 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:utf-16be'} = {
1229 ascii16 => 1,
1230 ascii16be => 1,
1231 bom_allowed =>
1232 '1',
1233 no_bom_variant =>
1234 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16be',
1235 no_bom_variant16be =>
1236 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16be',
1237 ietf_name =>
1238 ['utf-16be'],
1239 mime_name =>
1240 'utf-16be',
1241 'uri',
1242 {'urn:x-suika-fam-cx:charset:utf-16be',
1243 '1'},
1244 };
1245  
1246 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:utf-16le'} = {
1247 ascii16 => 1,
1248 ascii16le => 1,
1249 bom_allowed =>
1250 '1',
1251 no_bom_variant =>
1252 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16le',
1253 no_bom_variant16le =>
1254 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16le',
1255 ietf_name =>
1256 ['utf-16le'],
1257 mime_name =>
1258 'utf-16le',
1259 'uri',
1260 {'urn:x-suika-fam-cx:charset:utf-16le',
1261 '1'},
1262 };
1263  
1264 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16be'} = {
1265 ascii16 => 1,
1266 ascii16be => 1,
1267 is_block_safe =>
1268 '1',
1269 perl_name =>
1270 ['utf-16be'],
1271 'uri',
1272 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16be',
1273 '1'}};
1274 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16le'} = {
1275 ascii16 => 1,
1276 ascii16le => 1,
1277 is_block_safe =>
1278 '1',
1279 perl_name =>
1280 ['utf-16le'],
1281 'uri',
1282 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-16le',
1283 '1'}};
1284 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-10646-ucs-2'} = $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:iso-10646-ucs-2'} = {
1285 ascii16 => 1,
1286 bom_allowed =>
1287 '1',
1288 no_bom_variant =>
1289 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.ucs-2le',
1290 no_bom_variant16be =>
1291 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.ucs-2be',
1292 no_bom_variant16le =>
1293 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.ucs-2le',
1294 ietf_name =>
1295 ['csunicode',
1296 'iso-10646-ucs-2'],
1297 mime_name =>
1298 'iso-10646-ucs-2',
1299 'uri',
1300 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-10646-ucs-2',
1301 '1',
1302 'urn:x-suika-fam-cx:charset:iso-10646-ucs-2',
1303 '1'},
1304 xml_name => 'ISO-10646-UCS-2',
1305 };
1306  
1307 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.ucs-2be'} = {
1308 ascii16 => 1,
1309 ascii16be => 1,
1310 is_block_safe =>
1311 '1',
1312 perl_name =>
1313 ['ucs-2be'],
1314 'uri',
1315 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.ucs-2be',
1316 '1'}};
1317 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.ucs-2le'} = {
1318 ascii16 => 1,
1319 ascii16le => 1,
1320 is_block_safe =>
1321 '1',
1322 perl_name =>
1323 ['ucs-2le'],
1324 'uri',
1325 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.ucs-2le',
1326 '1'}};
1327 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-10646-ucs-4'} = $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:iso-10646-ucs-4'} = {
1328 ascii32 => 1,
1329 bom_allowed =>
1330 '1',
1331 no_bom_variant =>
1332 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-32le',
1333 no_bom_variant32endian1234 =>
1334 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-32be',
1335 no_bom_variant32endian4321 =>
1336 'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-32le',
1337 ietf_name =>
1338 ['csucs4',
1339 'iso-10646-ucs-4'],
1340 mime_name =>
1341 'iso-10646-ucs-4',
1342 'uri',
1343 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-10646-ucs-4',
1344 '1',
1345 'urn:x-suika-fam-cx:charset:iso-10646-ucs-4',
1346 '1'},
1347 xml_name => 'ISO-10646-UCS-4',
1348 };
1349  
1350 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-32be'} = {
1351 ascii32 => 1,
1352 ascii32endian1234 => 1,
1353 is_block_safe =>
1354 '1',
1355 perl_name =>
1356 ['ucs-4be',
1357 'utf-32be'],
1358 'uri',
1359 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-32be',
1360 '1'}};
1361 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-32le'} = {
1362 ascii32 => 1,
1363 ascii32endian4321 => 1,
1364 is_block_safe =>
1365 '1',
1366 perl_name =>
1367 ['ucs-4le',
1368 'utf-32le'],
1369 'uri',
1370 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.utf-32le',
1371 '1'}};
1372 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:iso_8859-1:1987'} = $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-1'} = {ascii8 =>
1373 '1',
1374 is_block_safe =>
1375 '1',
1376 ietf_name =>
1377 ['cp819',
1378 'csisolatin1',
1379 'ibm819',
1380 'iso-8859-1',
1381 'iso-8859-1',
1382 'iso-ir-100',
1383 'iso_8859-1',
1384 'iso_8859-1:1987',
1385 'l1',
1386 'latin1'],
1387 mime_name =>
1388 'iso-8859-1',
1389 perl_name =>
1390 ['iso-8859-1',
1391 'latin1'],
1392 'uri',
1393 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-1',
1394 '1',
1395 'urn:x-suika-fam-cx:charset:iso_8859-1:1987',
1396 '1'},
1397 xml_name => 'ISO-8859-1',
1398 };
1399  
1400 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-2'} = {ascii8 =>
1401 '1',
1402 is_block_safe =>
1403 '1',
1404 'uri',
1405 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-2',
1406 '1'},
1407 xml_name => 'ISO-8859-2',
1408 };
1409  
1410 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-3'} = {ascii8 =>
1411 '1',
1412 is_block_safe =>
1413 '1',
1414 'uri',
1415 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-3',
1416 '1'},
1417 xml_name => 'ISO-8859-3',
1418 };
1419  
1420 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-4'} = {ascii8 =>
1421 '1',
1422 is_block_safe =>
1423 '1',
1424 'uri',
1425 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-4',
1426 '1'},
1427 xml_name => 'ISO-8859-4',
1428 };
1429  
1430 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-5'} = {ascii8 =>
1431 '1',
1432 is_block_safe =>
1433 '1',
1434 'uri',
1435 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-5',
1436 '1'},
1437 xml_name => 'ISO-8859-5',
1438 };
1439  
1440 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-6'} = {ascii8 =>
1441 '1',
1442 is_block_safe =>
1443 '1',
1444 'uri',
1445 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-6',
1446 '1'},
1447 xml_name => 'ISO-8859-6',
1448 };
1449  
1450 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-7'} = {ascii8 =>
1451 '1',
1452 is_block_safe =>
1453 '1',
1454 'uri',
1455 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-7',
1456 '1'},
1457 xml_name => 'ISO-8859-7',
1458 };
1459  
1460 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-8'} = {ascii8 =>
1461 '1',
1462 is_block_safe =>
1463 '1',
1464 'uri',
1465 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-8',
1466 '1'},
1467 xml_name => 'ISO-8859-8',
1468 };
1469  
1470 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-9'} = {ascii8 =>
1471 '1',
1472 is_block_safe =>
1473 '1',
1474 'uri',
1475 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-9',
1476 '1'},
1477 xml_name => 'ISO-8859-9',
1478 };
1479  
1480 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-10'} = {ascii8 =>
1481 '1',
1482 is_block_safe =>
1483 '1',
1484 'uri',
1485 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-10',
1486 '1'},
1487 xml_name => 'ISO-8859-10',
1488 };
1489  
1490 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-11'} = {ascii8 =>
1491 '1',
1492 is_block_safe =>
1493 '1',
1494 'uri',
1495 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-11',
1496 '1'},
1497 xml_name => 'ISO-8859-11',
1498 };
1499  
1500 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-13'} = {ascii8 =>
1501 '1',
1502 is_block_safe =>
1503 '1',
1504 'uri',
1505 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-13',
1506 '1'},
1507 xml_name => 'ISO-8859-13',
1508 };
1509  
1510 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-14'} = {ascii8 =>
1511 '1',
1512 is_block_safe =>
1513 '1',
1514 'uri',
1515 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-14',
1516 '1'},
1517 xml_name => 'ISO-8859-14',
1518 };
1519  
1520 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-15'} = {ascii8 =>
1521 '1',
1522 is_block_safe =>
1523 '1',
1524 'uri',
1525 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-15',
1526 '1'},
1527 xml_name => 'ISO-8859-15',
1528 };
1529  
1530 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-16'} = {ascii8 =>
1531 '1',
1532 is_block_safe =>
1533 '1',
1534 'uri',
1535 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-8859-16',
1536 '1'},
1537 xml_name => 'ISO-8859-16',
1538 };
1539  
1540 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-2022-jp'} = {ascii8 =>
1541 '1',
1542 'uri',
1543 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.iso-2022-jp',
1544 '1'},
1545 xml_name => 'ISO-2022-JP',
1546 };
1547  
1548 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:iso-2022-jp'} = {ascii8 =>
1549 '1',
1550 ietf_name =>
1551 ['csiso2022jp',
1552 'iso-2022-jp',
1553 'iso-2022-jp'],
1554 mime_name =>
1555 'iso-2022-jp',
1556 'uri',
1557 {'urn:x-suika-fam-cx:charset:iso-2022-jp',
1558 '1'},
1559 };
1560  
1561 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.iso-2022-jp'} = {ascii8 =>
1562 '1',
1563 perl_name =>
1564 ['iso-2022-jp'],
1565 'uri',
1566 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.iso-2022-jp',
1567 '1'}};
1568 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:shift_jis'} = $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.shift_jis'} = {ascii8 =>
1569 '1',
1570 is_block_safe =>
1571 '1',
1572 ietf_name =>
1573 ['csshiftjis',
1574 'ms_kanji',
1575 'shift_jis',
1576 'shift_jis'],
1577 mime_name =>
1578 'shift_jis',
1579 perl_name =>
1580 ['shift-jis-1997'],
1581 'uri',
1582 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.shift_jis',
1583 '1',
1584 'urn:x-suika-fam-cx:charset:shift_jis',
1585 '1'},
1586 xml_name => 'Shift_JIS',
1587 };
1588  
1589 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.shiftjis'} = {ascii8 =>
1590 '1',
1591 is_block_safe =>
1592 '1',
1593 perl_name =>
1594 ['shiftjis',
1595 'sjis'],
1596 'uri',
1597 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.shiftjis',
1598 '1'}};
1599 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:euc-jp'} = $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.euc-jp'} = $HTML::HTML5::Parser::Charset::CharsetDef->{'urn:x-suika-fam-cx:charset:extended_unix_code_packed_format_for_japanese'} = {ascii8 =>
1600 '1',
1601 is_block_safe =>
1602 '1',
1603 ietf_name =>
1604 ['cseucpkdfmtjapanese',
1605 'euc-jp',
1606 'euc-jp',
1607 'extended_unix_code_packed_format_for_japanese'],
1608 mime_name =>
1609 'euc-jp',
1610 perl_name =>
1611 ['euc-jp-1997'],
1612 'uri',
1613 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/XML.euc-jp',
1614 '1',
1615 'urn:x-suika-fam-cx:charset:euc-jp',
1616 '1',
1617 'urn:x-suika-fam-cx:charset:extended_unix_code_packed_format_for_japanese',
1618 '1'},
1619 xml_name => 'EUC-JP',
1620 };
1621  
1622 9 $HTML::HTML5::Parser::Charset::CharsetDef->{'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.euc-jp'} = {ascii8 =>
1623 '1',
1624 is_block_safe =>
1625 '1',
1626 perl_name =>
1627 ['euc-jp',
1628 'ujis'],
1629 'uri',
1630 {'http://suika.fam.cx/~wakaba/archive/2004/dis/Charset/Perl.euc-jp',
1631 '1'}};
1632  
1633 9 1;
1634 ## $Date: 2008/09/15 07:19:03 $
« blib/lib/HTML/HTML5/Parser/Tokenizer.pm ↑ Summary blib/lib/HTML/HTML5/Parser/TagSoupParser.pm »