On Sat, 27 May 2017 07:06:59 -0700, c...@zoffix.com wrote:
> Seems something with decoding actually, since using char of different
> size or adding another char after the heart avoids the issue:
>
> <Zoffix___> m: my $f1 = "/tmp/foo121212".IO; $f1.spurt: "fo♥";
> $f1.open.readchars(2).say
> <camelia> rakudo-moar 0c5fe5: OUTPUT: «fo♥»
> <Zoffix___> m: my $f1 = "/tmp/foo121212".IO; $f1.spurt: "fo♥z";
> $f1.open.readchars(2).say
> <camelia> rakudo-moar 0c5fe5: OUTPUT: «fo»
> <Zoffix___> m: my $f1 = "/tmp/foo121212".IO; $f1.spurt: "foz";
> $f1.open.readchars(2).say
> <camelia> rakudo-moar 0c5fe5: OUTPUT: «fo»
>
Fixed and tested in S16-io/readchars.t.