On 28/05/09 21:35, miyagawa@gmail.com via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=46423 >
>
> On Thu, May 28, 2009 at 1:10 PM, Chris Hastie via RT
> <bug-Net-Twitter-OAuth@rt.cpan.org> wrote:
>> Yes. I've also tried getting characters in a way more allied to how they
>> are likely to turn up in the app for real:
>>
>> $status = HTML::Entities::decode("A test status 6
>> 기러기");
>
> Works fine for me (assuming they're Korean Hangul characters):
>
http://twitter.com/miyagawa/status/1951462759
Ho hum, seems like our mileage differs, as they say.
I have managed to get things to work with this patch to Net/OAuth/Message.pm
--- Message.pm.orig Thu May 28 20:27:21 2009
+++ Message.pm 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 {
With this applied, I need to do an encode('UTF-8', $status) to get
things to work. I've tried various things, encoding or not, patched or
not, and watched the value of $request_url being hit in
Net::OAuth::Simple::_make_request, and the value of
$request->signature_base_string
Here's a summary - I've only included the relevant parts
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.