r60183 - in /trunk/libhtml-parser-perl: Changes META.yml Parser.pm debian/changelog lib/HTML/HeadParser.pm t/headparser.t

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Sat Jul 10 06:59:01 UTC 2010


Author: carnil-guest
Date: Sat Jul 10 06:58:14 2010
New Revision: 60183

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60183
Log:
New upstream release

Modified:
    trunk/libhtml-parser-perl/Changes
    trunk/libhtml-parser-perl/META.yml
    trunk/libhtml-parser-perl/Parser.pm
    trunk/libhtml-parser-perl/debian/changelog
    trunk/libhtml-parser-perl/lib/HTML/HeadParser.pm
    trunk/libhtml-parser-perl/t/headparser.t

Modified: trunk/libhtml-parser-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-parser-perl/Changes?rev=60183&op=diff
==============================================================================
--- trunk/libhtml-parser-perl/Changes (original)
+++ trunk/libhtml-parser-perl/Changes Sat Jul 10 06:58:14 2010
@@ -1,3 +1,10 @@
+_______________________________________________________________________________
+2010-07-09  Release 3.66
+
+Gisle Aas (1):
+      Fix entity decoding in utf8_mode for the title header
+
+
 _______________________________________________________________________________
 2010-04-04  Release 3.65
 

Modified: trunk/libhtml-parser-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-parser-perl/META.yml?rev=60183&op=diff
==============================================================================
--- trunk/libhtml-parser-perl/META.yml (original)
+++ trunk/libhtml-parser-perl/META.yml Sat Jul 10 06:58:14 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               HTML-Parser
-version:            3.65
+version:            3.66
 abstract:           HTML parser class
 author:
     - Gisle Aas <gisle at activestate.com>

Modified: trunk/libhtml-parser-perl/Parser.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-parser-perl/Parser.pm?rev=60183&op=diff
==============================================================================
--- trunk/libhtml-parser-perl/Parser.pm (original)
+++ trunk/libhtml-parser-perl/Parser.pm Sat Jul 10 06:58:14 2010
@@ -9,7 +9,7 @@
 use strict;
 use vars qw($VERSION @ISA);
 
-$VERSION = "3.65";
+$VERSION = "3.66";
 
 require HTML::Entities;
 

Modified: trunk/libhtml-parser-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-parser-perl/debian/changelog?rev=60183&op=diff
==============================================================================
--- trunk/libhtml-parser-perl/debian/changelog (original)
+++ trunk/libhtml-parser-perl/debian/changelog Sat Jul 10 06:58:14 2010
@@ -1,5 +1,6 @@
-libhtml-parser-perl (3.65-2) UNRELEASED; urgency=low
-
+libhtml-parser-perl (3.66-1) UNRELEASED; urgency=low
+
+  * New upstream release
   * Remove Kenneth Pronovici from Uploaders as requested in
     http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/2010-July/034136.html 
   * Refresh debian/copyright file.

Modified: trunk/libhtml-parser-perl/lib/HTML/HeadParser.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-parser-perl/lib/HTML/HeadParser.pm?rev=60183&op=diff
==============================================================================
--- trunk/libhtml-parser-perl/lib/HTML/HeadParser.pm (original)
+++ trunk/libhtml-parser-perl/lib/HTML/HeadParser.pm Sat Jul 10 06:58:14 2010
@@ -87,7 +87,7 @@
 use strict;
 use vars qw($VERSION $DEBUG);
 #$DEBUG = 1;
-$VERSION = "3.62";
+$VERSION = "3.66";
 
 =item $hp = HTML::HeadParser->new
 
@@ -157,7 +157,10 @@
     $text =~ s/\s+/ /g;
     print "FLUSH $tag => '$text'\n"  if $DEBUG;
     if ($tag eq 'title') {
+	my $decoded;
+	$decoded = utf8::decode($text) if $self->utf8_mode && defined &utf8::decode;
 	HTML::Entities::decode($text);
+	utf8::encode($text) if $decoded;
 	$self->{'header'}->push_header(Title => $text);
     }
     $self->{'tag'} = $self->{'text'} = '';

Modified: trunk/libhtml-parser-perl/t/headparser.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhtml-parser-perl/t/headparser.t?rev=60183&op=diff
==============================================================================
--- trunk/libhtml-parser-perl/t/headparser.t (original)
+++ trunk/libhtml-parser-perl/t/headparser.t Sat Jul 10 06:58:14 2010
@@ -1,7 +1,7 @@
 #!perl -w
 
 use strict;
-use Test::More tests => 15;
+use Test::More tests => 16;
 
 { package H;
   sub new { bless {}, shift; }
@@ -147,7 +147,7 @@
 ok(!$p->as_string);
 
 SKIP: {
-  skip "Need Unicode support", 4 if $] < 5.008;
+  skip "Need Unicode support", 5 if $] < 5.008;
 
   # Test that the Unicode BOM does not confuse us?
   $p = HTML::HeadParser->new(H->new);
@@ -177,4 +177,20 @@
 
   is($p->header("title"), "Parkinson's disease");
   is($p->header("link")->[0], '<../../css/ummAdam.css>; rel="stylesheet"; type="text/css"');
+
+  $p = HTML::HeadParser->new(H->new);
+  $p->utf8_mode(1);
+  $p->parse(<<"EOT");   # example from http://www.mjw.com.pl/
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> \r
+\r
+<head profile="http://gmpg.org/xfn/11">\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+\r
+<title> ko\xC5\x84c\xC3\xB3wki kolekcji, outlet, hurtownia odzie\xC5\xBCy Warszawa &#8211; MJW</title>\r
+<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />\r
+
+EOT
+    $p->eof;
+    is($p->header("title"), "ko\xC5\x84c\xC3\xB3wki kolekcji, outlet, hurtownia odzie\xC5\xBCy Warszawa \xE2\x80\x93 MJW");
 }




More information about the Pkg-perl-cvs-commits mailing list