Escape and unescape UTF-8 characters.

This is almost identical to the code that I submitted a long time ago
to Zend Framework and to the one that I’m using since then for my Full
UTF-8 WordPress plugin.