Skip Menu |
Report information
Id: 128513
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: zefram [at]

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Date: Fri, 1 Jul 2016 20:10:23 +0100
Subject: [BUG] utf8-c8 confuses Str.perl
From: Zefram <zefram [...]>
To: rakudobug [...]
Download (untitled) / with headers
text/plain 753b
Str.perl fails to represent whatever is being used by the utf8-c8 encoding to represent a non-UTF-8 octet. Thus .perl.EVAL fails to round-trip the Str that arises in the middle of a utf8-c8 decode-then-encode round-tripping of an octet string. Show quoted text
> Blob[uint8].new(233, 1).decode("utf8-c8").encode("utf8-c8").perl
Blob[uint8].new(233,1) Show quoted text
> Blob[uint8].new(233, 1).decode("utf8-c8").perl.EVAL.encode("utf8-c8").perl
Blob[uint8].new(244,143,191,189,120,69,57,1) If that mangled octet string is then used as a second input value, the two Str values arising from decoding these two octet strings compare !eq (as they should), but their .perl representations compare eq. This shows that the problem is on the .perl side, rather than the .EVAL side. -zefram
Date: Fri, 1 Jul 2016 21:37:00 +0100
To: perl6 via RT <perl6-bugs-followup [...]>
Subject: Re: [perl #128513] [BUG] utf8-c8 confuses Str.perl
From: Zefram <zefram [...]>
Download (untitled) / with headers
text/plain 320b
Additional: an apparently-null string operation, such as substituting a substring (appearing in the Str) with itself, can mangle the string in the same manner as .perl.EVAL: Show quoted text
> Blob[uint8].new(233, 1).decode("utf8-c8").subst("\x[1]", "\x[1]").encode("utf8-c8").perl
Blob[uint8].new(244,143,191,189,120,69,57,1) -zefram
From: Zefram <zefram [...]>
Subject: Re: [perl #128513] [BUG] utf8-c8 confuses Str.perl
To: perl6 via RT <perl6-bugs-followup [...]>
Date: Mon, 27 Feb 2017 07:06:32 +0000
This problem still occurs with the rewritten UTF8-C8 implementation. -zefram

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at