HTML Entities Conversion


Sole Developer


Look familiar?

Here’s the problem. Your web page has certain characters that cannot be displayed properly. Instead of typographer’s quotes (“curly quotes” instead of foot ' and inch " marks), ‘e acute’ (as in the word résumé), the copyright symbol (©), registered symbol (®), etc., usually copied from a program like Microsoft Word, your webpage renders with the dreaded “black diamond question mark” symbol: �

There are many attempted solutions to this problem, which stems from what are called character sets.  The web was originally designed to use the ASCII(American Standard Code for Information Interchange)
A character-encoding scheme originally based on the English alphabet. ASCII codes represent text characters - in computers, communications equipment, and other devices that use text - as a number.
character set, with special symbols being rendered with what are called html entities.  For example, you would put © in the text and the browser would render © - the copyright symbol.

No matter how hard you try, setting up databases and servers and pages for an advanced character set like UTF8 - which natively will render those pesky special characters - the dreaded “black diamond question mark” symbol � will still pop up.

The solution: I wrote a function that converts these special ( muliti-byte ) characters to proper html entities.  The function can be applied when storing or retrieving data for display, and you end up with no more strange characters on your website.  This function is now used on dozens of web sites.

php java W3C jQuery jQuery Mobile Knockout Omniture Google Analytics SVN Apache MySQL Adobe Zend MCSE