All Posts by Email, Once a Week

Media Temple logo

CSS-Tricks is brought to you in part by Media Temple, the web hosting that we both use and recommend.

Suggested DOC type to avoid using unicode characters

  • # October 3, 2012 at 11:05 am

    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?

    # October 3, 2012 at 11:25 am

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

    # October 3, 2012 at 11:40 am

    This reply has been reported for inappropriate content.

    thanks Senff, all I needed.

    __
    # October 3, 2012 at 9:20 pm

    This reply has been reported for inappropriate content.

    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.

    # October 4, 2012 at 7:25 am

    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
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed