endline characters

Scott Mazur kubuntulists at littlefish.ca
Sun Feb 11 01:25:17 UTC 2007


On Sat, 10 Feb 2007 15:40:49 -0800, Maynard Wright wrote
> In days of yore, Unix used a single line feed (0A hex) to terminate 
> a line of text and DOS used a carriage return - line feed pair (OD 
> hex 0A hex).  When moving files back and forth between the two 
> systems, it was often necessary to convert the endline (sometimes 
> called "newline") characters one way or the other.
> 
> This situation seemed to prevail through RedHat 8 (LF) and W98SE (CR-
> LF).  In attempting to resolve some issues involved with porting 
> code from Linux to Windows XP, I see that the situation seems to 
> have been reversed.  Although Kate under RH8 defaulted to LF 
> endlines, Kate under Dapper defaults to CR-LF.  Conversely, a file 
> edited by Notepad under Windows XP and emailed to me (I don't have 
> any OS other than Linux anymore) used only LF endlines.
> 
> Although I haven't found a definitive commentary on this aspect of 
> Windows, a Google search seems to indicate that up through W98SE,
>  Microsoft OS used CR-LF, but that OS since that version, including 
> XP, use LF as an endline character.
> 
> Any thoughts or further information on this?

Far as I know windows continues to use CR-LF, mac uses CR and Linux/unix uses
LF.  Many text editors are smarter than they used to be.  Can't say much for
kate because I rarely use it (too much bloat), but kwrite (which is likely the
same code base) automatically detects the endline format used in the file and
sticks with it when you edit the file.  You can also manually set the line
ending in kwrite to the OS format of your choice which makes converting line
end formats when needed a snap.

I've recently had to work with EasyGradePro file import/exports and they have
chosen to insist on CR record terminators for all their file imports,
regardless of OS the application may be running on.  Seems a strange choice
unless their user base is overwhelmingly mac based.

Scott

-- 
Registered Linux user #395249, http://counter.li.org
Nothing goes to waste when Little Fish are near!
(http://www.littlefish.ca)





More information about the kubuntu-users mailing list