fix text encoding for new lines