- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 09 Aug 2005 14:07:28 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/css
In directory hutz:/tmp/cvs-serv10240
Modified Files:
XMLStyleSheetHandler.java
Log Message:
removed the default to iso-8859-1, it may lead to "fun" issues, but it is
in sync with http://www.w3.org/TR/xhtml-media-types/#text-html
Note that xerces 2.7.1 and below has trouble with InputSource
set with an encoding of iso-8859-1, parsing a XML 1.1 document, with a XML declaration
of UTF-8, and with an attribue in iso-8859-2. The trouble is... infinite loop.
Index: XMLStyleSheetHandler.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/XMLStyleSheetHandler.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- XMLStyleSheetHandler.java 8 Aug 2005 13:18:04 -0000 1.13
+++ XMLStyleSheetHandler.java 9 Aug 2005 14:07:25 -0000 1.14
@@ -520,15 +520,12 @@
MimeType repmime = new MimeType(ctype);
if (repmime.hasParameter("charset")) {
source.setEncoding(repmime.getParameterValue("charset"));
- } else {
- // if text/html and no given charset, let's assume
- // iso-8859-1. Ideally, the parser would change the
- // encoding if it find a mismatch, not sure, but well...
- if (repmime.match(MimeType.TEXT_HTML) ==
- MimeType.MATCH_SPECIFIC_SUBTYPE) {
- source.setEncoding("iso-8859-1");
- }
}
+ // if not, then we may be in trouble.
+ // http://www.w3.org/TR/xhtml-media-types/#text-html
+ // says that UA should not assume any defaut charset
+ // the XML decl is a SHOULD and not a MUST, and the
+ // meta http-equiv is more than evil
} catch (Exception ex) {}
}
source.setSystemId(urlString);
Received on Tuesday, 9 August 2005 14:07:34 UTC