W3C home > Mailing lists > Public > public-qa-dev@w3.org > December 2009

Re: Preparing for validator 0.8.6 release

From: Karl Dubost <karl+w3c@la-grange.net>
Date: Tue, 8 Dec 2009 06:58:03 -0500
Message-Id: <285B2905-DA32-420A-A0BA-FBB3993ADD5D@la-grange.net>
Cc: Ville U2t5dHSPq6M= <ville.skytta@iki.fi>, public-qa-dev <public-qa-dev@w3.org>
To: Michael(tm) Smith <mike@w3.org>

Le 8 déc. 2009 à 04:21, Michael(tm) Smith a écrit :
> Does it include a fix for bug 5592 (Validator ignores HTML5 encoding declaration)?
> 
>  http://www.w3.org/Bugs/Public/show_bug.cgi?id=5992

not yet.

http://search.cpan.org/dist/HTML-Encoding/lib/HTML/Encoding.pm
source code: http://cpansearch.perl.org/src/BJOERN/HTML-Encoding-0.60/lib/HTML/Encoding.pm


A bit of logic to add here:


sub encoding_from_meta_element
{
# …

    foreach (grep { $_->[0] eq "meta" } @$meta)
    {
        my %hash = %{$_->[1]};
        next unless defined $hash{'content'} ;
        next unless lc $hash{'http-equiv'} eq "content-type";
        my $char = encoding_from_content_type($hash{'content'});
        push @resu, $char if defined $char and length $char;
    }
# …
}

would something like this be ok: (my perl is rusty)


    foreach (grep { $_->[0] eq "meta" } @$meta)
    {
        my %hash = %{$_->[1]};
	if (next unless defined $hash{'content'})
     	{
	    next unless lc $hash{'http-equiv'} eq "content-type";
            my $char = encoding_from_content_type($hash{'content'});
        }
	else
        {
	    my $char = encoding_from_content_type($hash{'charset'})
        }
        push @resu, $char if defined $char and length $char;
    }




-- 
Karl Dubost
Montréal, QC, Canada
http://www.la-grange.net/karl/
Received on Tuesday, 8 December 2009 11:58:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 19 August 2010 18:12:50 GMT