EOL, LF, no CR in accompanying TXT files

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
Demetris
Silver Member
Silver Member
Posts: 217
Joined: 2004 Jul 04, 17:18

EOL, LF, no CR in accompanying TXT files

Post by Demetris »

Has this been discussed before?

Apart from changes.txt, the other four TXT files that come with x2:

Editor2.txt
licence.txt
registry.txt
x2tips.txt

only have LF for EOL, and they do not display correctly in Notepad.

The same goes for the readme.txt that comes with narayan’s PDF.

Why is this?
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Those files were probably created in a non-windoze-specific environment, CP/M-Unix-Linux-Mac-etc or another app where the extra CR is not used for a new line. Rather in those more advanced apps&OS's the CR often signified a new paragraph. I think early Wordstar and/or Wordperfect also did this when they were little more than glorified text editors with a relatively few printer control characters imbedded in the otherwise text data stream.
Notepad is, unfortunately, rooted in the past where both LineFeed [0A] and CarriageReturn [0D] were required in the data stream to control the teletype units which were used for printing the output 50 or more years ago.
LF by itself would just advance the paper, but leave the printhead at current horizontal location. CR was needed to return the printhead to the left margin, and without LF the TTY would type the next line over the prior one.  

Bottom line is: don't use notepad. It's as obsolete as TTY.   :roll:
Cosmo
Gold Member
Gold Member
Posts: 465
Joined: 2007 Apr 17, 11:09

Post by Cosmo »

fgagnon wrote:Bottom line is: don't use notepad. It's as obsolete as TTY.   :roll:
Hm, fact is, that notepad is the default text-editor / viewer in any Windows system, and - if you like it or not - defaults are mostly the actual settings in the majority of all pc's, so they should be respected. I think so, although I am happy with editor2, that I have set as the standard-text-program in my machine.
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Your point is valid, Thomas. :|

Unfortunately, M$ has not updated that ancient thing.  
Yet if I recall correctly when I set up my XP machine 5yrs ago, there was a choice of using notepad or wordpad for the default. That was before I found 2X & X2 & E2.  Still, you know which I chose. :shrug:
wasker
Gold Member
Gold Member
Posts: 799
Joined: 2005 Oct 21, 16:33
Location: WA, USA
Contact:

Post by wasker »

AFAIR, there's no choice of default text editor: both get installed and Notepad is always a default handler for TXT files.

So, I think all these files should be reformatted for Notepad to be able to show their contents without any additional friction.
I'm using Xplorer2 - the only file manager that does not suck. Actually, it rocks!
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

Well, I only tried to address why it happened;
but I acknowledge the issue in general (even while deprecating M$ for being troglodytic in the matter).

nikos,
Even though it doesn't affect me, I add my vote to the above two users request for compatibility with the aforementioned notepad limitation.
If you agree, I'll even redo the files & send them to you for distribution with the next edition if you would prefer to not bother with it yourself.  
-Fred-
User avatar
nikos
Site Admin
Site Admin
Posts: 15806
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

that was from the time when i was mental with shaving off bytes from everywhere, including linefeeds :)
Demetris
Silver Member
Silver Member
Posts: 217
Joined: 2004 Jul 04, 17:18

Post by Demetris »

:-P

There HAD to be an explanation!

It seems this discipline paid off, after all! :-)

So, are we going to get the carriage returns back now? :-)
User avatar
fgagnon
Site Admin
Site Admin
Posts: 3737
Joined: 2003 Sep 08, 19:56
Location: Springfield

Post by fgagnon »

BTW - the ORDER of CR & LF is important -
Why that is evolved from the TTY machine mechanical response time properties.

Because it took the TTY longer to return the printhead to the left margin than to advance the platen one line, CR always preceded LF in to give the machine an extra tenth of a second to respond before the next typing character was received and printed.  
-- The rate was typically 5 or 10 characters per second.  :shock: --

True to its ancient heritage, even today, troglodytic notepad messes up if CR doesn't precede LF.
So --- the fix for the files in question is to use a hex editor to replace every instance of [0A] with  [0D][0A]. :shrug:
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Post by FrizzleFry »

Most editors that are not simply trying to be notepad replacements include text conversion features: EditPad Lite, Notepad++, PSPAD for example.

There are also many unix to dos command line conversion utilities that can be used to automate the conversion to that these text files are in the right format in the install package.  Google for "tofrodos" for a version compiled for win32.
User avatar
nikos
Site Admin
Site Admin
Posts: 15806
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Post by nikos »

editor2 can do it to just search for newlines and replace with CRLF. There is a list of special characters for this purpose in replace dialog
Cosmo
Gold Member
Gold Member
Posts: 465
Joined: 2007 Apr 17, 11:09

Post by Cosmo »

The problem also exists - not surprisingly - for the readme_beta.txt file. Nikos, this is only a reminder in case, that you should replace the LF with CRLF in the future distributions.
Post Reply