Encoding and escaping unicode characters

In working on a web-based application that needs to support unicode and other DBCS encodings, I created a simple bookmarklet that converts a string into HTML entities. You can find it on the bottom of my bookmarklets page if you happen to need it.

On a somewhat related note, I keep forgetting to write about the reasonably successful conclusion of my quest to find a way to URL encode UTF8 characters for Netscape 4.x and Internet Explorer 5.0. Several people wrote excellent comments and even kindly sent me example code for reproducing the JavaScript encodeURIComponent() function on those browsers that don’t support it natively. Thanks for the help!