W3C home > Mailing lists > Public > www-validator-cvs@w3.org > December 2010

markup-validator commit: Avoid warning with autodetected UTF-16[BL]E docs without a BOM.

From: Mercurial notifier <nobody@w3.org>
Date: Thu, 16 Dec 2010 15:35:51 +0000
Message-Id: <E1PTFrz-0004Zm-R2@mcbain.w3.org>
To: markup-validator updates <www-validator-cvs@w3.org>
changeset:   3198:6dbe979d2d79
user:        Ville Skyttä <ville.skytta@iki.fi>
date:        Thu Dec 16 17:33:20 2010 +0200
files:       httpd/cgi-bin/check
description:
Avoid warning with autodetected UTF-16[BL]E docs without a BOM.


diff -r 484148259191 -r 6dbe979d2d79 httpd/cgi-bin/check
--- a/httpd/cgi-bin/check	Wed Dec 15 00:28:56 2010 +0200
+++ b/httpd/cgi-bin/check	Thu Dec 16 17:33:20 2010 +0200
@@ -461,7 +461,10 @@
 elsif ($File->{Charset}->{XML}) {
     $File->{Charset}->{Use} = $File->{Charset}->{XML};
 }
-elsif ($File->{Charset}->{Auto} =~ /^utf-16[bl]e$/ && $File->{BOM} == 2) {
+elsif ($File->{BOM} &&
+    $File->{BOM} == 2 &&
+    $File->{Charset}->{Auto} =~ /^utf-16[bl]e$/)
+{
     $File->{Charset}->{Use} = 'utf-16';
 }
 elsif ($File->{ContentType} =~ m(^application/([-.a-zA-Z0-9]+\+)?xml$)) {
Received on Thursday, 16 December 2010 15:35:53 UTC

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