Improve documentNotUTF8 check in ToolsError for HTML support

Improve documentNotUTF8 check to allow <meta> character set declarations in HTML documents.