treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Suggested DOC type to avoid using unicode characters

  • I work in with alot of marketers in a tech company, they hand me swathes of copy, much of it containing special characters beyond apostrophes. So when I'm building a landing page using the HTML5 "<!doctype html>" I have to go in and scan the page for special characters, look up the unicode equivalent, update, re-load... and its just a waste of time when I'm pressed for time.

    What would be the next best DOC type that I could use to avoid having to do this?

  • Don't change the doctype -- make sure you get the right charset setting. Usually, having this in the HEAD is enough:

      <meta charset="UTF-8">
    
  • thanks Senff, all I needed.

  • Don't change the doctype -- make sure you get the right charset setting. Usually, having this in the HEAD is enough
    <meta charset="UTF-8">
    --Senff

    usually. However, be aware that if your server sends an HTTP header specifying another charset, almost all browsers will ignore your meta tag and go with whatever your server says.

  • as @traq said, you can you force UTF-8 with .htaccess using this

    
    AddDefaultCharset utf-8
    AddCharset utf-8 .css .js .xml .json .rss .atom