Explicit imports. (XMLWriter.encode): New. Encode the given string from a format used by Thuban into UTF-8. Fixes RTbug #1851.