Search This Blog

Saturday 4 February 2012

Moving Web Sites Forward

An article from Google today says that 60% of the web is now in Unicode. Interesting. It made me wonder what encoding I was using on the three small web sites I maintain. Turned out to be ISO-8859-1.

Can't have that: I do this sort of thing for a living, and this makes my edge feel decidedly less than 'cutting'. I resolve to move straightaway to UTF-8 encoding, and move onto HTML5 while I'm about it.

Well, what an improvement! This is what the top of one of my HTML files looked like before:

   <?xml version="1.0" encoding="iso-8859-1"?>
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <body>
      <meta content="text/html; charset=iso-8859-1" http-equiv="content-type"/>

and this is what it looks like now:

   <!DOCTYPE html>
   <html lang="en-GB">
   <body>
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type">

I'd never liked the header stuff before, as it was verbose, repetitive, and error-prone. I'd never even bothered to learn its rules, and would just cut and paste an existing file when I needed to start a new web page. HTML5 throws all that dross away, and leaves little more than the absolutely bare minimum to get the job done.

That was basically all it took, apart from my £ signs, which were now showing up as solid black diamonds; they simply had to be changed to "&pound;".

So, make that 60.000001% of the web.