# HG changeset patch # User "Rex Tsai " # Date 1225274026 -28800 # Node ID 8155f93283963ab70deeade977ef6c32f404aaac # Parent 279a000eb3b0e81daf9304ae43fb5878aba4145b# Parent 839d8ad81cdefebc549c2872a7658330dda6f70a merged. diff -r 839d8ad81cde -r 8155f9328396 Ikariam.pm --- a/Ikariam.pm Wed Oct 29 16:03:43 2008 +0800 +++ b/Ikariam.pm Wed Oct 29 17:53:46 2008 +0800 @@ -41,7 +41,7 @@ sub parse { my ($self, $content) = @_; my $string; - my $parser = XML::LibXML->new('1.0','utf-8'); + my $parser = XML::LibXML->new('1.0','UTF-8'); if($self->{gzip} == 1) { gunzip \$content => \$string @@ -50,7 +50,7 @@ $string = $content; } - $self->{doc} = $parser->parse_html_string ($string, { suppress_errors => 1 }); + $self->{doc} = $parser->parse_html_string ($string, { suppress_errors => 1, encoding => 'utf-8' }); return; } @@ -188,7 +188,8 @@ if($href =~ /index\.php\?view=sendMessage&with=(\d+)&oldView=highscore/) { $user{'id'} = $1; $user{'name'} = $user; - $user{'name'} = $extractor->find('//td[@class="name"]'); + # encoding issue. + $user{'name'} = $extractor->find('//td[@class="name"]/text()'); $user{'ally'} = $extractor->find('//td[@class="allytag"]/a/text()'); my $allyHref = $extractor->find('//td[@class="allytag"]/a/@href');