There are two basic solutions:
1) Write the data out to a temp file, and then open that.
2) Use regular expressions to make the newlines the way you want. You are probably looking at three combinations: windows (\r\n), old mac (\r), *nix (\n). You probably just want to convert everything to a single type (probably the last one). You want to probably start with the windows type when converting.
I am ignoring the Unicode returns, and the few other types, but that should probably get you where you want to go.