Encode the message to a utf-8 string.