RivetEntities
Introduction 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
encode encode a string replacing every occurrence of characters for which an SGML entity exists ::rivet::encode string Description ::rivet::encode returns a copy of the input string after replacing every occurence of characters for which an SGML entity exists. By default the command assumes the string is encoded in UTF-8, other encodings are supported by passing the -encoding <encoding> argument. The list of available encodings is returned by command encoding names decode decode an SGML encoded string replacing every entity with the corresponding character ::rivet::decode string Description ::rivet::decode implements the inverse function of ::rivet::encode. The input string is scanned searching and replacing every SGML entity with its corresponding character. By default the command assumes the output string has to be encoded in UTF-8. Other encodings are supported by passing the -encoding <encoding> argument.