encode messages with newlines rather than json