This encodes a series of Unicode codes into a UTF-8 string. You can supply any number of arguments, which must be numbers in the range 0 to 2147483647. Any argument can also be a numerically-keyed table, in which case each sequential item (in the range 1 .. n) is also processed. If you supply a table the keys must not have gaps, or any item after the gap will be ignored. By supplying a table you can conveniently supply a large number of codes to be converted.
The function returns a string which is the appropriate UTF-8 encoded string. It raises an error if the arguments cannot be converted to numbers, are out of range, or have decimal places (eg. 5.5).
eg.
print (utils.tohex (utils.utf8encode (5000))) --> E18E88
print (utils.tohex (utils.utf8encode (5000, 10000))) --> E18E88E29C90
print (utils.tohex (utils.utf8encode ( { 5000, 10000 } ))) --> E18E88E29C90