Subject: | Invalid UTF-8 characters may break some functions, and possibly unrelated 'hang' in get_inbox |
Date: | Tue, 30 Oct 2007 00:26:20 +0000 |
To: | bug-www-myspace [...] rt.cpan.org |
From: | Steven Chamberlain <steven [...] pyro.eu.org> |
Hi,
I've had some if these errors coming up intermittently over the last few
weeks, but now they seem to appear almost all of the time:
Malformed UTF-8 character (unexpected continuation byte 0xa5, with no
preceding start byte) in substitution (s///) at
/usr/local/share/perl/5.8.8/WWW/Myspace.pm line 3568.
I believe this happens when users have used HTML entities such as
♥ in their display names. On some of Myspace's pages, these
entities are served to the browser as actual (ASCII?) characters which I
believe are invalid UTF-8, when they should be encoded as an HTML entity.
Until recently, I only noticed this problem when one of the messages in
the inbox had ♥ in the message subject.
This now happens in the recently-added 'Who's Online?' panel appearing
to the right of the Myspace Mail (messages) inbox. The result is that
if anyone with certain certain HTML entities in their display name
happens to be online at the time, then an attempt to read inbox messages
with WWW::Myspace, fails with the above error message.
Running in 'C' locale is a possible workaround:
LANG=C ./myscript.pl
I'm not sure if that workaround works or not, because I am now being
affected by a possibly unrelated problem with get_inbox.
During a call to get_inbox, after WWW::Myspace has downloaded the inbox
page from Myspace, it hangs with 100% CPU usage. I have tested this
both with an empty inbox, and with an inbox containing a (read) message.
I'm afraid I know very little about Perl, but I figured out how to trace
line-by-line using 'perl -d:Trace' and found that it stops at
Myspace.pm:3868:
Show quoted text
>> /usr/local/share/perl/5.8.8/WWW/Myspace.pm:3567:
last if ( $options{'stop_at'} && ( $options{'stop_at'} == $3 ) );
Show quoted text >> /usr/local/share/perl/5.8.8/WWW/Myspace.pm:3568:
push @messages,
I hope that the information I've provided so far is helpful, please let
me know if there is anything else I can do to debug this.
Regards,
--
Steven Chamberlain
steven@pyro.eu.org