W3C home > Mailing lists > Public > www-validator-cvs@w3.org > June 2009

validator/httpd/cgi-bin check,1.664,1.665

From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 29 Jun 2009 19:57:53 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MLMzB-0006fC-MF@lionel-hutz.w3.org>
Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv25579/httpd/cgi-bin

Modified Files:
	check 
Log Message:
Move Encode alias definitions to charset.cfg, register also our non-recommended but recognized aliases.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.664
retrieving revision 1.665
diff -u -d -r1.664 -r1.665
--- check	29 Jun 2009 18:21:16 -0000	1.664
+++ check	29 Jun 2009 19:57:51 -0000	1.665
@@ -191,6 +191,12 @@
   }
 
   #
+  # Register Encode aliases.
+  while (my ($key, $value) = each %{$CFG->{Charsets}}) {
+    Encode::Alias::define_alias($key, $1) if ($value =~ /^[AX] (\S+)/);
+  }
+
+  #
   # Set debug flag.
   if ($CFG->{'Allow Debug'}) {
     $DEBUG = TRUE if $ENV{W3C_VALIDATOR_DEBUG} || $CFG->{'Enable Debug'};
@@ -568,31 +574,6 @@
 # Abort if an error was flagged while finding the encoding.
 &abort_if_error_flagged($File, O_CHARSET|O_DOCTYPE);
 
-#
-# Encode alias definitions. This might not be the best
-# place for them, feel free to move them elsewhere.
-
-# implicit bidi, but character encoding is the same
-Encode::Alias::define_alias('iso-8859-6-i', 'iso-8859-6');
-
-# implicit bidi, but character encoding is the same
-Encode::Alias::define_alias('iso-8859-8-i', 'iso-8859-8');
-
-# 0xA0 is U+00A0 in ISO-8859-11 but undefined in tis-620
-# other than that the character encodings are equivalent
-Encode::Alias::define_alias('tis-620', 'iso-8859-11');
-
-# Encode::Byte does not know 'macintosh' but MacRoman
-Encode::Alias::define_alias('macintosh', 'MacRoman');
-
-# x-mac-roman is the non-standard version of 'macintosh'
-Encode::Alias::define_alias('x-mac-roman', 'MacRoman');
-
-# Encode only knows the long hand version of 'ksc_5601'
-Encode::Alias::define_alias('ksc_5601', 'KS_C_5601-1987');
-
-# gb18030 requires Encode::HanExtra but no additional alias
-
 $File->{Charset}->{Default} = FALSE;
 unless ($File->{Charset}->{Use}) { # No charset given...
      $File->{Charset}->{Use} = 'utf-8';
@@ -601,7 +582,6 @@
     &add_warning('W04', {W04_charset => "UTF-8"});
 }
 
-
 # Always transcode, even if the content claims to be UTF-8
 $File = transcode($File);
 if (($File->{ContentType} eq "text/html") and ($File->{Charset}->{Default}) and $File->{'Error Flagged'}) {
Received on Monday, 29 June 2009 19:58:06 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:36 UTC