I did a search and all I could find were endless webpages on how to escape individual characters with a slash - perhaps my search skills need work.
If you still wanted to take the route you are going, you could replace
\" if you are using double-quoted strings in your script) and replace
\\n, which replaces real newlines with newline escapes.
©2020 All rights reserved.