Skip Menu |

This queue is for tickets about the Hash-MD5 CPAN distribution.

Report information
The Basics
Id: 101606
Status: resolved
Priority: 0/
Queue: Hash-MD5

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.04
Fixed in: 0.05



Subject: Fails for unicode character >= \x{0100}
If an array or hash contains values with unicode characters above 255, then Hash::MD5 fails: $ perl5.18.4 -MHash::MD5=sum_array -e 'sum_array(["\x{0100}"]);' Wide character in subroutine entry at /opt/perl-5.18.4/lib/site_perl/5.18.4/Hash/MD5.pm line 101.
On 2015-01-18 13:30:02, SREZIC wrote: Show quoted text
> If an array or hash contains values with unicode characters above 255, > then Hash::MD5 fails: > > $ perl5.18.4 -MHash::MD5=sum_array -e 'sum_array(["\x{0100}"]);' > Wide character in subroutine entry at /opt/perl- > 5.18.4/lib/site_perl/5.18.4/Hash/MD5.pm line 101.
characters are not bytes. Hash::MD5 needs to either encode_utf8() all strings it receives, or clearly document that it operates on bytestrings, not character strings (thereby forcing the caller to encode the string first).