Skip Menu |

This queue is for tickets about the Type-Tiny CPAN distribution.

Report information
The Basics
Id: 101582
Status: resolved
Priority: 0/
Queue: Type-Tiny

People
Owner: perl [...] toby.ink
Requestors: andre [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 1.001_013



Subject: Malformed UTF-8 character warnings in Perl 5.10 with utf8 pragma on
The following code in Perl 5.10: use utf8; use Types::Standard qw/Dict Int/; use Type::Params qw/compile/; compile( Dict [ foo => Int ] ); Will generate the following output: Malformed UTF-8 character (unexpected continuation byte 0xb8, with no preceding start byte) in subroutine entry at lib/Type/Params.pm line 155. Malformed UTF-8 character (unexpected non-continuation byte 0x3b, immediately after start byte 0xd0) in subroutine entry at lib/Type/Params.pm line 155. Malformed UTF-8 character (unexpected non-continuation byte 0x78, immediately after start byte 0xf8) in subroutine entry at lib/Type/Params.pm line 155. Malformed UTF-8 character (unexpected non-continuation byte 0x3b, immediately after start byte 0xd0) in subroutine entry at lib/Type/Params.pm line 155. Malformed UTF-8 character (unexpected non-continuation byte 0x3b, immediately after start byte 0xd0) in subroutine entry at lib/Type/Params.pm line 155. Malformed UTF-8 character (unexpected continuation byte 0xb8, with no preceding start byte) in subroutine entry at lib/Type/Params.pm line 155. ... I have not tested older versions of Perl (5.8, 5.6), but I believe they will fail too. After 5.10, B::perlstring() was made an alias to B::cstring(): http://perl5.git.perl.org/perl.git/commitdiff/84556172294db864f27a4b5df6dac9127e1e7205 If we replace all instances of B::perlstring with B::cstring in the "compile" subroutine in Test::Params, the issue goes away. I'll make a pull request with a test case on GitHub.
A couple of further comments: I verified that older Perls have the same issue, 5.8, 5.6, etc. I also created a pull request on github: https://github.com/tobyink/p5-type-tiny/pull/16 I hope this helps. Thank you for all your work on Type::Tiny, Toby Inkster, it's an awesome dist!
fixed