--- senastemail.pl Thu Jan 18 07:51:02 2007 +++ senastemail2.pl Tue Apr 15 13:46:46 2008 @@ -201,12 +201,13 @@ # # # +# sub parsehtmlfile { my ($file) = @_; open(FILE, "<$file"); - my ($date, $name, $email, $subject, $inreplyto); + my ($date, $name, $email, $subject, $inreplyto, $charset); while() { if(/^/) { last; } } close(FILE); + + if($charset =~ /utf-*8/i) { + # this is utf-8 while we have the output in iso8859-1 so we need + # a convertion + $subject =~ s/\"/MMMMM/g; + $subject = `echo "$subject" | iconv -f utf8 -t iso8859-1`; + $subject =~ s/MMMMM/\"/g; + } + return $date, $name, $email, $subject, $inreplyto; }