From: Gisle Aas Date: Wed, 11 Apr 2001 16:36:11 +0000 (-0700) Subject: Digest::MD5 on UTF8 strings X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=844f02137cf6ad0a6e99a608c42836b56ef19aef;p=p5sagit%2Fp5-mst-13.2.git Digest::MD5 on UTF8 strings Message-ID: p4raw-id: //depot/perl@9689 --- diff --git a/ext/Digest/MD5/MD5.xs b/ext/Digest/MD5/MD5.xs index 40110c3..6fd9b48 100644 --- a/ext/Digest/MD5/MD5.xs +++ b/ext/Digest/MD5/MD5.xs @@ -1,5 +1,3 @@ -/* $Id: MD5.xs,v 1.26 2000/09/18 14:27:44 gisle Exp $ */ - /* * This library is free software; you can redistribute it and/or * modify it under the same terms as Perl itself. @@ -553,7 +551,7 @@ add(self, ...) STRLEN len; PPCODE: for (i = 1; i < items; i++) { - data = (unsigned char *)(SvPV(ST(i), len)); + data = (unsigned char *)(SvPVbyte(ST(i), len)); MD5Update(context, data, len); } XSRETURN(1); /* self */ @@ -618,7 +616,7 @@ md5(...) PPCODE: MD5Init(&ctx); for (i = 0; i < items; i++) { - data = (unsigned char *)(SvPV(ST(i), len)); + data = (unsigned char *)(SvPVbyte(ST(i), len)); MD5Update(&ctx, data, len); } MD5Final(digeststr, &ctx); diff --git a/t/lib/md5-file.t b/t/lib/md5-file.t index ca9cac7..d0f0d03 100644 --- a/t/lib/md5-file.t +++ b/t/lib/md5-file.t @@ -21,7 +21,7 @@ EOT } else { # ASCII $EXPECT = <