Subject: | Failure with UTF-8 encoded data (with patch) |
The symptom is this error:
Wide character in subroutine entry at [...]/Flickr/API.pm line 48.
The problem is in the computation of the hash for the arguments in sub
sign_args. A simple fix, suggested by the Digest::MD5 docs, worked for me
and is attached.
-Steve
Subject: | flickr_api_encode_utf8.patch |
--- API.pm.orig 2010-08-14 21:33:05.000000000 -0500
+++ API.pm 2010-08-14 21:33:08.000000000 -0500
@@ -7,6 +7,7 @@ use XML::Parser::Lite::Tree;
use Flickr::API::Request;
use Flickr::API::Response;
use Digest::MD5 qw(md5_hex);
+use Encode qw(encode_utf8);
our @ISA = qw(LWP::UserAgent);
@@ -45,7 +46,7 @@ sub sign_args {
$sig .= $key . $value;
}
- return md5_hex($sig);
+ return md5_hex(encode_utf8($sig));
}
sub request_auth_url {