recode

recode is a simple program for performing conversions between many different character sets.

I often use it to encode HTML and other code snippets before uploading them to the web.

jmccrohan@lambda:~$ echo '<strong>Hello, World!</strong>' | recode utf8..html
&lt;strong&gt;Hello, World!&lt;/strong&gt;