changeset 111:8155f9328396

merged.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Wed, 29 Oct 2008 17:53:46 +0800
parents 279a000eb3b0 (diff) 839d8ad81cde (current diff)
children ef5461db3951 da0dd597401c
files
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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');