On 2/3/19 4:56 PM, ToddAndMargo via perl6-users wrote:
(Blob) method decode
multi method decode(Blob:D: Str:D $encoding = 'UTF-8' --> Str:D)
Applies an encoding to turn the blob into a Str.
my Blob $blob = "string".encode('utf-8');
say $blob.decode('utf-8'); # OUTPUT: «string␤»
On malformed utf-8 .decode will throw X::AdHoc. To handle
sloppy utf-8 use utf8-c8.
where are the decode options? I only see utf-8 and utf8-c8.
Am I blind?
Found it and I am not blind. The Docs just stink. I would
write an RFE for this, but, the odds of them accepting it are
so close to zero that it is not worth the effort.
And what is with?
Str:D $encoding = 'UTF-8'
$encoding can accept a whole bunch of things. And
What the heck is `'UTF-8'`? It sure ain't "utf8" or
My own docs: