Unicode on webpages      contents


Why does my cell phone XHTML browser show odd characters on my webpage?

Newer cell phones have XHTML support, and there is a tendency to move from WML to XHTML. Because there are minimal differences between XHTML and plain HTML you can use cell phone to browse the same Web with some restrictions.

As hardware of cell phones hardware is more limited, it don't support legacy encodings. You need to use UTF-8 or escape each symbol outside US-ASCII with decimal code. For example write ą instead of ą

When using UTF-8 both in WML and XHTML you should specify encoding="UTF-8" in xml hader. "meta http-equiv" isn't supported by XHTML MP specification, though it can be used for the sake of other HTML browsers. Pvz.:

<?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">
<html xmlns="http://www.w3.org/1999/xhtml"
	xml:lang="en" lang="en">
<head>
   <meta http-equiv="content-type"
	content="text/html; charset=UTF-8" />
   <title>My page</title>
</head>
<body>
<p>
text
<br/>
résumé
</p>
</body>
</html>

DOCTYPE in this example has limited feature set because it is destined for limited cell phone capabilities.

You can read more about XHTML for mobile devices in Nokia XHTML Content Development page and common WWW consortium recommendation.



  Valid XHTML 1.0!