16

Ask DN: It's 2015; do we still need to escape common typographic marks in HTML?

over 4 years ago from , Head of Design at Amino

Back in the day, we learned to diligently escape our carefully chosen typographic marks (like apostrophes) with their HTML entities (like ’). If we forgot, some browsers would render garbage characters, which sucked.

I just copied a bunch of copy from a Google doc—which is nice enough to automatically convert single quotes to typographically correct apostrophes—into an HTML file I'm working on. Out of a habit 12 years in the making, I immediately hit CMD-F to find and replace all the in the HTML with ’ (and the same for double quotes).

And then I paused and thought, "WTF." Do I still really need to do this? I can't imagine any browser used in 2015 needs to be spoon fed an HTML entity to render .

Everything I can find online about this issue is years old. Can we move on, or will we need to keep escaping forever?

3 comments

  • Kelly SuttonKelly Sutton, over 4 years ago

    Provided you have the following meta tag in your <head></head>...

    <meta charset="utf-8">

    ...you should be okay including UTF-8 characters in normal HTML. That being said, if you have a CMS or anything that touches/stores/generates the HTML that is not UTF-8-friendly, you're going to have a bad time.

    15 points
    • Marc EdwardsMarc Edwards, over 4 years ago (edited over 4 years ago )

      This has been my experience as well. I haven’t seen any issues using utf-8, and many tools actually convert escaped characters to utf-8 characters (Hammer does it, if you’re working with Markdown files).

      2 points
    • , over 4 years ago

      Makes sense. Thanks!

      0 points