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

Owner: Nobody
Requestors: cpan [at] zoffix.com
Cc:
AdminCc:

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



Subject: [JVM] IO::Handle.readchars incorrectly assumes all chars are 2 bytes long
Download (untitled) / with headers
text/plain 634b
Based on the code, seems it's a naive kludge for the unimplemented nqp::readcharsfh op. As a result, .readchars on JVM reads incorrect number of chars, at times producing wrong data altogether: <ZoffixW> j: "/tmp/Foo.pm6".IO.spurt: "I♥u so very much"; "/tmp/Foo.pm6".IO.open.readchars(3).say <camelia> rakudo-jvm fb4f16: OUTPUT: «I♥u ␤» <ZoffixW> j: "/tmp/Foo.pm6".IO.spurt: "I love you so very much"; "/tmp/Foo.pm6".IO.open.readchars(3).say <camelia> rakudo-jvm fb4f16: OUTPUT: «I love␤» <ZoffixW> j: "/tmp/Foo.pm6".IO.spurt: "♥"; "/tmp/Foo.pm6".IO.open.readchars(1).say <camelia> rakudo-jvm fb4f16: OUTPUT: «�␤»


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

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