add UTF8 check, prevents mismatched encoding getting through to breaking xsl translations