File comparison, edit mode: CR gets corrupted

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

File comparison, edit mode: CR gets corrupted

Post by *StatusQuo »

When comparing binary files which are containing different forms of Carriage Return, the CR-characters get corrupted:

- 0Ah (Carriage Return in *NIX-Format) automatically gets changed
to 0Dh (Carriage Return in Mac-Format),

- 0A 0Dh (Carriage Return in Wind*ws-Format) automatically gets changed
to 0Dh (Carriage Return in Mac-Format),

both without a warning or question to the user.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
Flint
Power Member
Power Member
Posts: 3487
Joined: 2003-10-27, 09:25 UTC
Location: Antalya, Turkey
Contact:

Post by *Flint »

StatusQuo
Please, read help:
<...> When saving, the type of line end (Windows, Unix, Mac) is determined by the majority of line ends of the original file, e.g. if the original contained Windows line ends with a few Unix line ends, the saved file will contain only Windows line ends.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 10.52 / Win10 x64
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

Flint wrote:StatusQuo
Please, read help:
<...> When saving, the type of line end (Windows, Unix, Mac) is determined by the majority of line ends of the original file, e.g. if the original contained Windows line ends with a few Unix line ends, the saved file will contain only Windows line ends.
Tested and found the problem (probably a user fault): binary files can't be edited/changed in the File-Compare-Editmode, so the "binary" checkbox had to be turned off to make changes possible at all. Unfortunately this also makes the file content be interpreted as "text in lines" - including the above behaviour.

So I learned: binary files can't be changed (yet) with TC's File-Compare Editmode.
Thanks for the hint.
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

So I learned: binary files can't be changed (yet) with TC's File-Compare Editmode
That's correct. Don't edit binary files in text mode, because this will convert them to a text file on saving it.
Author of Total Commander
https://www.ghisler.com
Post Reply