Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 48073
Status: resolved
Priority: 0/
Queue: Net-Twitter

People
Owner: MMIMS [...] cpan.org
Requestors: abesto0 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.04001
Fixed in: (no value)



Subject: Sending UTF-8 updates
Updates sent from a UTF-8 environment produce wrong-charset artifacts. A script is attached that reproduces the problem. I've found a workaround, but I don't know how it affects the system in other scenarios: removing/commenting out line 71 in Net/Twitter/API.pm (utf8::upgrade $_ for values %$args;) fixes it for me. perl -v: This is perl, v5.10.0 built for i686-linux-thread-multi uname -a: Linux keyrit 2.6.30-ARCH #1 SMP PREEMPT Fri Jul 3 02:32:03 PDT 2009 i686 Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz GenuineIntel GNU/Linux echo $LANG: en_US.utf8
Subject: twitter-utf.pl
use Net::Twitter; my $nt = Net::Twitter->new( traits => [qw/API::REST/], username => 'user', password => 'pass' ); my $result = $nt->update('árvíztűrő tükörfúrógép'); eval { my $statuses = $nt->friends_timeline({ since_id => $high_water, count => 100 }); for my $status ( @$statuses ) { print "$status->{time} <$status->{user}{screen_name}> $status->{text}\n"; } }; if ( my $err = $@ ) { die $@ unless blessed $err && $err->isa('Net::Twitter::Error'); warn "HTTP Response Code: ", $err->code, "\n", "HTTP Message......: ", $err->message, "\n", "Twitter error.....: ", $err->error, "\n"; }
Subject: Re: [rt.cpan.org #48073] Sending UTF-8 updates
Date: Wed, 22 Jul 2009 00:09:49 -0700
To: bug-Net-Twitter [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
Your code is saved in utf-8 but doesn't have "use utf8" so Perl doesn't know which encoding your update is saved. Add "use utf8" in the head, or and this update should work correctly. Similarly if you read update text from somewhere user input (like from file or from cgi request) you should decode "utf-8", $input accordingly. On Wed, Jul 22, 2009 at 12:00 AM, Zoltán Nagy via RT<bug-Net-Twitter@rt.cpan.org> wrote: Show quoted text
> Wed Jul 22 03:00:42 2009: Request 48073 was acted upon. > Transaction: Ticket created by abesto >       Queue: Net-Twitter >     Subject: Sending UTF-8 updates >   Broken in: 3.04001 >    Severity: Normal >       Owner: Nobody >  Requestors: abesto0@gmail.com >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=48073 > > > > Updates sent from a UTF-8 environment produce wrong-charset artifacts. A > script is attached that reproduces the problem. I've found a workaround, > but I don't know how it affects the system in other scenarios: > removing/commenting out line 71 in Net/Twitter/API.pm (utf8::upgrade $_ > for values %$args;) fixes it for me. > > perl -v: This is perl, v5.10.0 built for i686-linux-thread-multi > > uname -a: Linux keyrit 2.6.30-ARCH #1 SMP PREEMPT Fri Jul 3 02:32:03 PDT > 2009 i686 Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz GenuineIntel > GNU/Linux > > echo $LANG: en_US.utf8 > >
-- Tatsuhiko Miyagawa
From: abesto0 [...] gmail.com
Oh. Sorry about reporting it as a bug then. The bughunt started from using twirssi, and it seems I made a mistake similar to theirs. Thanks.
Subject: Re: [rt.cpan.org #48073] Sending UTF-8 updates
Date: Wed, 22 Jul 2009 09:19:35 +0200
To: "miyagawa [...] gmail.com via RT" <bug-Net-Twitter [...] rt.cpan.org>
From: Zoltán Nagy <abesto0 [...] gmail.com>
Oh. Sorry about reporting it as a bug then. The bughunt started from using twirssi, and it seems I made a mistake similar to theirs. Thanks. - abesto
Download (untitled)
application/pgp-signature 197b

Message body not shown because it is not plain text.

I'm marking this one resolved. I believe all the unicode issues have been resolved. (Current version is 3.05.) If a problem persists with a current version, please reopen the ticket. -Marc