Browse files

Fixed the latin-1/UTF-8 issue, thanks to miyagawa

  • Loading branch information...
1 parent 387801f commit 49eaa38d9553a30213ce846fb4b81cac5ba132c2 @semifor semifor committed May 30, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/Net/Twitter/API.pm
View
6 lib/Net/Twitter/API.pm
@@ -3,7 +3,7 @@ use Moose ();
use Carp;
use Moose::Exporter;
use URI::Escape;
-use Encode ();
+use utf8;
use namespace::autoclean;
@@ -63,8 +63,8 @@ sub twitter_api_method {
my $uri = URI->new($caller->_base_url($self) . "/$local_path.json");
- # UTF-8 encode get/post parameters
- @{$args}{keys %$args} = map { Encode::encode('UTF-8', $_) } values %$args;
+ # upgrade params to UTF-8 so latin-1 literals can be handled as UTF-8 too
+ utf8::upgrade $_ for values %$args;
return $self->_parse_result($request->($self->ua, $uri, $args));
};

0 comments on commit 49eaa38

Please sign in to comment.