This observed on the Java implementation. Is that the intended behavior? It is exactly the documented behavior, but it would seem better (certainly more Java-like) to output the newline sequence of the platform it's running on, thus "\r\n" when on Windows.
Bob
brianWed 19 Aug 2009
Is that the intended behavior?
Definitely - I've seen a enough bugs due to newlines and file encoding issues to last me a lifetime. I believe that host specific file encodings don't make sense in this age of networking - programs should port without outputing different text. Newlines are normalized as "\n" in all cases, charset always defaults to UTF-8, and binary data always uses network byte order.
tompalmerWed 19 Aug 2009
I think I like the style. Good job having guts.
Down side is things like HTTP that require "\r\n" in headers. But that can be done explicitly when needed, I suppose.
And someone should bring a lawsuit on Microsoft simply for keeping Notepad broken for so many years. I don't know if that's possible, but oh how I wish they weren't such vile idiots making that decision. (Have I ever said anything that strong on here before? Probably not. Few tech things will get me as riled up as Notepad not handling plain "\n".)
andyWed 19 Aug 2009
Few tech things will get me as riled up as Notepad not handling plain "\n"
Sure on alternatives. I just mean that many everyday folks still default to Notepad, then they open up "\n"-only files and think the files are broken (rather than placing the proper blame on Notepad).
bobjalex Tue 18 Aug 2009
This observed on the Java implementation. Is that the intended behavior? It is exactly the documented behavior, but it would seem better (certainly more Java-like) to output the newline sequence of the platform it's running on, thus "\r\n" when on Windows.
Bob
brian Wed 19 Aug 2009
Definitely - I've seen a enough bugs due to newlines and file encoding issues to last me a lifetime. I believe that host specific file encodings don't make sense in this age of networking - programs should port without outputing different text. Newlines are normalized as "\n" in all cases, charset always defaults to UTF-8, and binary data always uses network byte order.
tompalmer Wed 19 Aug 2009
I think I like the style. Good job having guts.
Down side is things like HTTP that require "\r\n" in headers. But that can be done explicitly when needed, I suppose.
And someone should bring a lawsuit on Microsoft simply for keeping Notepad broken for so many years. I don't know if that's possible, but oh how I wish they weren't such vile idiots making that decision. (Have I ever said anything that strong on here before? Probably not. Few tech things will get me as riled up as Notepad not handling plain "\n".)
andy Wed 19 Aug 2009
+Inf
davidclifton Thu 20 Aug 2009
Notepad++ http://notepad-plus.sourceforge.net/uk/site.htm
Instructions to force windows to use it when it would otherwise use notepad: http://notepad-plus.sourceforge.net/uk/download.php just open the section on
notepad replacement
.Do this everywhere - never go back.
tompalmer Thu 20 Aug 2009
Sure on alternatives. I just mean that many everyday folks still default to Notepad, then they open up "\n"-only files and think the files are broken (rather than placing the proper blame on Notepad).