VERY windy here too.
Anyway, if you want the newlines to display in the alert message, you need to replace them with \n.
So, the above replace code modified would look like:
$newString = str_replace(array("\n", "\r"), array('\n','\r'), $oldString);
I know that looks bizarre, but it works.