Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpunk committed Dec 29, 2023
1 parent 4a6f7fd commit bd375b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/YAML/PP/Loader.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ sub filename {
sub load_string {
my ($self, $yaml) = @_;
my $utf8 = $self->{utf8};
my $p = $self->parser;
if ($self->parser->can('new_reader')) {
my $p = ref $self->parser;
no strict 'refs';
if (defined &{$p."::new_reader"}) {
$self->parser->new_reader('YAML::PP::Reader' =>
input => $yaml,
utf8_in => $self->{utf8},
Expand All @@ -93,6 +94,7 @@ sub load_string {
input => $yaml,
utf8_in => $self->{utf8},
));
$self->load();
}
}

Expand Down
2 changes: 0 additions & 2 deletions t/58.utf8.t
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ subtest 'YAML::PP::LibYAML' => sub {
utf8 => 0,
);
my $p_default = YAML::PP::LibYAML->new(header => 0);
my $parser = $p_utf8->loader->parser;
warn __PACKAGE__.':'.__LINE__.$".Data::Dumper->Dump([\$parser], ['parser']);
subtest 'load unicode' => sub {
my $data = $p_utf8->load_string($utf8);
is $data->[0], $bear_perl, 'load utf8';
Expand Down

0 comments on commit bd375b9

Please sign in to comment.