Do we really need to use the html entity for em-dash?
You don't generally need to use HTML character entities if your HTML includes the meta tag <metacharset="utf-8"> and/or your editor supports Unicode. However, entities can be useful when:
- Your keyboard does not support the character you need to type. For example, many keyboards do not have em-dash or the copyright symbol.
- Your editor does not support Unicode (very common some years ago, but probably not today).
- You want to make it explicit in the source what is happening. For example, the code is clearer than the corresponding whitespace character.
- You need to escape HTML special characters like <, &, or ".
In our code we'll use things like < > = ' ' to encapsulate code. We don't want our code, like our tags, visible on the screen to our site visitors. But what about the cases when we do? Or maybe we want link text with a visible > at the end to encourage the visitor to click. We don't want our site thinking we are opening or closing a tag when we type in these characters, so we'd opt to use an HTML entity that signals to the site to show > and not confuse it with code we are writing