views:

44

answers:

2

Wikipedia's example of XHTML-MP:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.1//EN"
  "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile11.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <title>Hello</title>
  </head>
  <body>
    <p>Hello <a href="http://example.org/"&gt;world&lt;/a&gt;.&lt;/p&gt;
  </body>
</html>

This fails W3C validation with the error Input is not proper UTF-8, indicate encoding ! Bytes: 0xA9 0x20 0x32 0x30

Even if you add <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> and tell the validator it's UTF8, it gives this error.

If the XHTML-MP DOCTYPE is removed, it works fine. What is the deal?

+1  A: 

The problem is with the external DTD. If you change the DOCTYPE to this, it validates:

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd"&gt;
Jim Lamb
That validates, but it's a different version of XHTML-MP. I unfortunately need XHTML-MP 1.2 on the website I'm trying to validate, which gives the same error as the Wikipedia example. Version 1.0 doesn't support Javascript includes. Are these newer versions (1.1, 1.2) just not officially supported or what?
realworldcoder
Looks like the 1.1 DTD is encoded as iso-8859-1 rather than utf-8.
Jim Lamb
A: 

http://mobiready.com/launch.jsp?locale=en_EN validates it fine. Wierd

Also you don't need to use 1.1 in order to use JavaScript. Although it wouldn't validate on W3's checker,

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"&gt;

works just fine with almost all JavaScript supported phones.

nLL