Speaking of Line Feeds, I stumbled across some bizarre behaviour in my tests.
Create a test file called hi.txt with your favourite text editor:
Code: Select all
<255><254>hi there<SUB><CR><LF>
The first two characters in the file are ASCII 255 and 254. This is known as the Byte Order Mark (BOM) and is found at the start of all Windows Unicode (UTF-16, to be precise) files.
Anyways, once you’ve created the file, enter the following command:
Code: Select all
cmd /d /u /c type hi.txt > ansihi.txt
Edit ansihi.txt and you will find:
Code: Select all
hi there<SUB><CR>
The BOM is gone and so is the Line Feed!
But the weirdness doesn’t end there…
Code: Select all
fc /b ansihi.txt unihi.txt
Comparing files ansihi.txt and HI.TXT
00000000: 68 FF
00000001: 69 FE
00000002: 20 68
00000003: 74 69
00000004: 68 20
00000005: 65 74
00000006: 72 68
00000008: 1A 72
00000009: 0D 65
FC: HI.TXT longer than ansihi.txt
Do you see that? Line 7 of the output is missing!
Is this an fc bug? I wasn’t aware of it.
Well, I must go lie down in a darkened room with a damp cloth over my eyes now…
- SB