Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

newline character(s)

Does your software handle newline characters from other systems?

Linux/BSD    linefeed         ^J    10     x0A
Windows/IBM  return linefeed  ^M^J  13 10  x0D x0A
old Macs     return           ^M    13     x0D
others?

For reasons of insanity, I am going with using the Linux version of the newline character in my text files. But, when I bring my text files over to say Windows, some programs do not play nicely with newline characters in my text. How would you deal with this?

like image 218
Mark Stock Avatar asked Feb 24 '26 17:02

Mark Stock


1 Answers

As they say, be strict in what you write and liberal in what you read.

Your application should be able to work properly reading both line endings. If you want to use linefeeds, and potentially upset Windows users, that's fine.

But save for Notepad, most programs I play with seem to be happy with both methods.

(And I use Cygwin on Windows, which just makes everything interesting)

like image 108
Will Hartung Avatar answered Feb 27 '26 01:02

Will Hartung