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

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