Forum Moderators: open

Message Too Old, No Replies

Character encoding problem

validator.w3c.org

         

WebJoe

5:01 pm on May 23, 2004 (gmt 0)

10+ Year Member



I have two documents that both look like this:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>

 <title>Page titel</title>

 <meta http-equiv="expires" content="Sat, 01 Jan 2005" />

 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

 <meta http-equiv="Content-Language" content="de" />

 <meta name="Content-Language" content="de" />

 <link rel="StyleSheet" type="text/css" href="../style/font-style.css" />

</head>

<body>

</body>

</html>

One of the documents validates as XHTML 1.0 Transitional, with the other one I get the result "XHTML 1.0 Transitional (Tentatively Valid)!" because of character encoding mismatch.
I don't undderstand why it validates with one document (actually 90% of all documents of the site) but not with the other. Any ideas?

bull

6:08 pm on May 23, 2004 (gmt 0)

10+ Year Member



Are you really sure you have replaced all special german characters like üöäß to &uuml; etc.?

Besides, you should get consistent regarding languages:

... html xmlns="http://www.w3.org/1999/xhtml" xml:lang="[b]en[/b]">
<meta http-equiv="Content-Language" content="[b]de[/b]" />

WebJoe

9:30 pm on May 23, 2004 (gmt 0)

10+ Year Member



thanks for pointing that out, i'll fix that. and yes, i have all special characters replaced with the respective entity - I had one page where i missed one, and the validator warned me that there was a character not within the specified entity set. The error I get from the validator is:
The character encoding specified in the XML declaration (utf-8) is different from the value in the <meta> element (iso-8859-1). I will use the value from the XML declaration (utf-8) for this

so special characters in the body shouldn't matter

py9jmas

10:21 pm on May 23, 2004 (gmt 0)

10+ Year Member



This is similar to the lang error:
<?xml version="1.0" encoding="UTF-8"?>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

WebJoe

6:37 am on May 24, 2004 (gmt 0)

10+ Year Member



thanks py9jmas, i noticed when I fixed the lang problem and changed it to
<?xml version="1.0" encoding="ISO-8859-1"?>

so the problem i ssolved for the moment

I still don't understand why the validator sees this with only 5 or 6 documents and lets it pass on all the others. I guess it's a bug (or a feature)