Skip Menu |

This queue is for tickets about the Net-OAuth-Simple CPAN distribution.

Report information
The Basics
Id: 46424
Status: resolved
Priority: 0/
Queue: Net-OAuth-Simple

Owner: Nobody in particular
Requestors: chris [...]

Bug Information
Severity: (no value)
Broken in: 1.1
Fixed in: (no value)

Subject: Authorisation fails when posting 'wide' characters
Download (untitled) / with headers
text/plain 856b
I have reported a bug in Net::Twitter::OAuth at This appears to be a problem with Net::OAuth::Simple. When posting fields with 'wide' characters in to Twitter, Twitter returns "Failed to validate oauth signature or token". Net::OAuth::Simple throws an exception: post on failed: 401 Unauthorized at /usr/local/lib/perl5/site_perl/5.8.8/Net/OAuth/ line 567 Perl v5.8.8 built for amd64-freebsd Net::OAuth::Simple 1.1
Download (untitled) / with headers
text/plain 1.5k
This seems to be solved by patching Net/OAuth/ as follows: --- Thu May 28 20:27:21 2009 +++ Thu May 28 20:27:32 2009 @@ -86,7 +86,7 @@ sub encode { my $str = shift; $str = "" unless defined $str; - return URI::Escape::uri_escape_utf8($str,'^\w.~-'); + return URI::Escape::uri_escape($str,'^\w.~-'); } sub decode { I'm using Net::Twitter::OAuth. With this patch applied I need to use encode('UTF-8', $status) on my string first. Using a $status formed by $status = HTML::Entities::decode("A test status 6 기러기"); Watching the value of $request_url being hit in Net::OAuth::Simple::_make_request, and the value of $request->signature_base_string as I try various things gives (only the relevant parts here): Works: patched, encoded status=A+test+status+6+%EA%B8%B0%EB%9F%AC%EA%B8%B0 %26status%3DA%2520test%2520status%25206%2520%25EA%25B8%25B0%25EB%259F%25AC%25EA%25B8%25B0 Unpatched, unencoded &status=A+test+status+6+ %26status%3DA%2520test%2520status%25206%2520%25EA%25B8%25B0%25EB%259F%25AC%25EA%25B8%25B0 Unpatched, encoded &status=A+test+status+6+%EA%B8%B0%EB%9F%AC%EA%B8%B0 %26status%3DA%2520test%2520status%25206%2520%25C3%25AA%25C2%25B8%25C2%25B0%25C3%25AB%25C2%259F%25C2%25AC%25C3%25AA%25C2%25B8%25C2%25B0 You'll see that compared to what eventually worked, on an unpatched code I get the right signature_base_string if I don't encode, but the request_url has the wide characters stripped. To get the request URL right I have to encode, but that does something odd to signature_base_string.
Released 1.5 which requires the latest version of Net::OAuth which should fix this. Thanks! Simon

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

Please report any issues with to