encode for message text