The RivetEntities package was kindly provided by Harald Oehlmann and is largely taken from a simple yet clever encoder/decoder of HTML entities starting from a utf-8 character string. The original code writted by Andy Goth is at http://wiki.tcl.tk/26403. Package entities extends the functionality in the original code combining it with Tcl's 'encoding' command to encode/decode from any supported encoding