W3C home > Mailing lists > Public > www-validator-cvs@w3.org > July 2007

validator/httpd/cgi-bin check,1.542,1.543

From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 19 Jul 2007 08:18:33 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1IBRDV-0007Qb-3P@lionel-hutz.w3.org>

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv27307/httpd/cgi-bin

Modified Files:
	check 
Log Message:
re-populating the list of charsets (from older revisions in both branch 0.7 and 0.8)
to be used thus:
* no fatal error if the charset is supported by encode
* a warning with the suggestion for a better alias if we know one
* a warning that the encoding may be "odd" if not in the list but encode says it's OK



Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.542
retrieving revision 1.543
diff -u -d -r1.542 -r1.543
--- check	19 Jul 2007 06:21:03 -0000	1.542
+++ check	19 Jul 2007 08:18:30 -0000	1.543
@@ -2090,7 +2090,7 @@
   my $cs = $exact_charset;
 
   if ($CFG->{Charsets}->{$cs}) {
-    if ($CFG->{Charsets}->{$cs} =~ /Encoding Forbidden/) {
+    if ($CFG->{Charsets}->{$cs} =~ /ERR /) {
       # The encoding is not supported due to policy
       
       $File->{'Error Flagged'} = TRUE;
@@ -2102,10 +2102,13 @@
                                          "This encoding is not supported by the validator.");
       return $File;
     }
-    else {
+    elsif ($CFG->{Charsets}->{$cs} =~ /X /) {
+      # possibly problematic, we recommend another alias
+      my $recommended_charset = $CFG->{Charsets}->{$cs};
+      $recommended_charset =~ s/X //;
       &add_warning('W22', {
         W22_declared => $cs,
-        W22_suggested => $CFG->{Charsets}->{$cs},
+        W22_suggested => $recommended_charset,
       });      
     }
   }
@@ -2127,6 +2130,13 @@
 
     return $File;
   }
+  elsif (!$CFG->{Charsets}->{$cs}) {
+    # not in the list, but technically OK -> we warn
+    &add_warning('W23', {
+      W23_declared => $cs,
+    });      
+    
+  }
 
   my $output;
   my $input = $File->{Bytes};
Received on Thursday, 19 July 2007 08:18:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:54:58 GMT