New line in text or body

I use the scheduler to display events loaed from Outlook. Some of these events have a new line in the subject or body. The issue is that if there is such an event nothing will load, and there is an error in onLoadError event with the requestState=4. Temporarily I replaced \r\n with a space, but I would like to replace it with a new line and not sure how to do that…