in reply to Removing the ^M character, but also removing the newline
There is additional discussion of this issue here.