Encode/decode messages to support UTF8 characters