UPDATE: So many people have been asking about this script that for better or for worse, I am linking to the source code as a general resource. I hope you all can find this useful. The script is licenced under the BSD Licence.
This tool will take any string of characters from any charset and output them in a format which can be pasted as-is into the code of an HTML document. UTF-8 translated text can only be pasted into documents using the UTF-8 charset, while HTML Entities should display the proper characters under any charset.
Although HTML Entities are more portable with respect to HTML documents, it is recommended to use UTF-8 encoded bytes since a wider spectrum of applications (not just web browsers) can decode and display them.