Removing trouble characters like curly quotes and apostrophes in HTML documents

Often times there will be troublesome characters in your HTML. This is especially true if you've copied text out of word processors, such as Micorsoft Word. The problem is that these trouble characters are not ASCII, and therefore don't display correctly in the browser. These special characters need to instead be escaped, rather than placed directly into HTML.

There are many common characters that word processors use, such as curly quotes and apostrophes and ellipsis. The best thing to do anytime you copy from a word processor generated document is to convert the entire document to ASCII.

I use TextMate, so I take advantage of its conversion tool. Most other editors offer somthing very similar.

Here's a screenshot of where to find this in TextMate. Check your editor or search Google to find this tool in your editor.

Convert to ASCII in Textmate: Convert text to ASCII in TextMateConvert to ASCII in Textmate: Convert text to ASCII in TextMate

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Images can be added to this post.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.

More information about formatting options