convert to specified encoding - which may be sequence of
8-bit chars, or multi-byte encodings like UTF-8 or UTF-16.
The receiving end had better be expecting whatever encoding
is used here on the sending end!