W3C home > Mailing lists > Public > www-validator-cvs@w3.org > March 2005

validator/httpd/cgi-bin check,1.407,1.408

From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 24 Mar 2005 08:37:29 +0000
To: www-validator-cvs@w3.org
Message-ID: <E1DENqL-0004JA-Bs@lionel-hutz.w3.org>

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

Modified Files:
	check 
Log Message:

Modifying warnings when a charset override has been selected for a document with no charset declared at all.
Should fix http://www.w3.org/Bugs/Public/show_bug.cgi?id=1133


Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.407
retrieving revision 1.408
diff -u -d -r1.407 -r1.408
--- check	24 Mar 2005 02:41:12 -0000	1.407
+++ check	24 Mar 2005 08:37:26 -0000	1.408
@@ -454,29 +454,40 @@
   my ($override, undef) = split(/\s/, $File->{Opt}->{Charset}, 2);
   $File->{Charset}->{Override} = lc($override);
 
-  if ($File->{Opt}->{FB}->{Charset}) {
+  if ($File->{Opt}->{FB}->{Charset}) { # charset fallback mode
     unless ($File->{Charset}->{Use}) {
       &add_warning('W02', {W02_charset => $File->{Charset}->{Override}});
 
       $File->{Tentative} |= T_ERROR; # Tag it as Invalid.
       $File->{Charset}->{Use} = $File->{Charset}->{Override};
     }
-  } else {
-    # Warn about Override unless it's the same as the real charset...
-    unless ($File->{Charset}->{Override} eq $File->{Charset}->{Use}) {
-      &add_warning('W03', {
-        W03_use => $File->{Charset}->{Use},
-        W03_opt => $File->{Charset}->{Override},
-      });
-
+  } else { # charset "hard override" mode
+    if (! $File->{Charset}->{Use}) { # overriding "nothing"
+      &add_warning('W04', {W04_charset => $File->{Charset}->{Override}, W04_override => TRUE});
       $File->{Tentative} |= T_ERROR;
       $File->{Charset}->{Use} = $File->{Charset}->{Override};
+     }
+     else { #actually overriding something 
+      # Warn about Override unless it's the same as the real charset...
+    
+      unless ($File->{Charset}->{Override} eq $File->{Charset}->{Use}) {
+        &add_warning('W03', {
+          W03_use => $File->{Charset}->{Use},
+          W03_opt => $File->{Charset}->{Override},
+        });
+
+        $File->{Tentative} |= T_ERROR;
+        $File->{Charset}->{Use} = $File->{Charset}->{Override};
+      } 
     }
+    
+    
+    
   }
 }
 
 unless ($File->{Charset}->{Use}) { # No charset given...
-  &add_warning('W04', {});
+  &add_warning('W04', {W04_charset => 'UTF-8'});
   $File->{Tentative} |= T_ERROR; # Can never be valid.
   $File->{Charset}->{Use} = 'utf-8';
 }
Received on Thursday, 24 March 2005 08:37:32 GMT

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