- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 10 Aug 2005 13:44:29 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/css
In directory hutz:/tmp/cvs-serv17193
Modified Files:
XMLStyleSheetHandler.java
Log Message:
Index: XMLStyleSheetHandler.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/XMLStyleSheetHandler.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- XMLStyleSheetHandler.java 9 Aug 2005 14:07:25 -0000 1.14
+++ XMLStyleSheetHandler.java 10 Aug 2005 13:44:27 -0000 1.15
@@ -520,12 +520,15 @@
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 Wednesday, 10 August 2005 13:44:39 UTC