Jump to: navigation, search

Using UTF-8

Many folks using and authoring microformats have found that consistent use of UTF-8 in the toolchain helps ensure that microformatted international content (i.e. with non-ASCII7 characters) is preserved from publication to indexing to aggregation and addition to desktop applicaions. (You could say I personally have some incentive to get this to all work properly, or rather, that I end up being a good test case ;) Tantek Çelik




<meta http-equiv="content-type" content="text/html; charset=utf-8" />

e.g. here is a complete valid XHTML 1.0 Strict UTF-8 document

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 <html xmlns="">
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
     <title>Valid XHTML 1.0 UTF-8 document</title>

Sidenote: this (meta http-equiv) is perhaps the *only* meta tag worth using in an (X)HTML document.

Web Server

Make sure that you have configured the web server to also send the character set as UTF-8 for HTML documents. E.g. for Apache, you can put this in your .htaccess file:

 AddType 'text/html; charset=UTF-8' .html



using-utf-8 was last modified: Saturday, January 3rd, 2009