Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

sprintf does not convert UTF8 to \x{..} format when emitting in B::C #67

Open
@toddr

Description

@toddr

WARNING: this program MUST be in a file in UTF-8 mode, NOT Latin1

use utf8;
use warnings;

my $msg = "";
$SIG{__WARN__} = sub { $msg = shift };

sub SKRÈÈÈ;

my $victim = sprintf("%d", *SKRÈÈÈ);
$msg =~ m/Argument "\*main::SKR\\x\{c8}\\x\{c8}\\x\{c8}" isn.t numeric in sprintf/ and print "ok\n";
binmode STDOUT, ":utf8";
print "got=$msg\n"

when run with pure perl, you get:

ok
got=Argument "*main::SKR\x{c8}\x{c8}\x{c8}" isn't numeric in sprintf at foo.pl line 9.

when run with B::C, you get:

got=Argument "*main::SKRÈÈÈ" isn't numeric in sprintf at foo.pl line 9.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions