1

I was testing a program then I discovered if I have 55 or 63 1 and line feed

hex (31) and hex (0A)

notepad fails to open the file? it shows gibberish (see screenshot)

enter image description here

This is what the hex editor look like: enter image description here

But if I open the file in notepad++ , it opens ok. attached is the text file in question. http://wikisend.com/download/485846/tt.txt

I made a mistake: I figured out the patern. if I have 49 of "1". notepad can open the file OK (this is on windows 10 64 bit). Anything above 49, notepad cannot open it.

screenshot, this is tt49.txt working OK enter image description here

enter image description here

this is the sample file that notepad can open http://wikisend.com/download/456646/tt49.txt

BobNoobGuy
  • 1,551
  • 2
  • 30
  • 62

1 Answers1

1

This is due to Notepad's limitation of how to understand line breaks.

It expects them to be encoded as HEX0d0a (CARRIAGE RETURN LINE FEED, CR LF, \r\n), otherwise it will fail to understand the encoding. Notepad++, Sublime Text, and basically every other modern Editor nowadays have no problems understanding different kinds of line breaks.

Look, e.g., here for additional info.

idleherb
  • 1,072
  • 11
  • 23
  • Any idea why is it happen only when I have certain number of characters? if I have 54 it opens fine? but if I add to 55 then it fails to open? – BobNoobGuy Jun 02 '16 at 18:59
  • I cannot reproduce this behavior. Notepad does not show any correct characters in my case, regardless how many `310a` sequences my file has. – idleherb Jun 02 '16 at 20:23
  • Thanks for testing it. but I actually find the pattern. 49 is the key number. anything above 49 notepad breaks. I am on 64bit windows 10 OS I don't know if that matters. can you open this file and see if notepad load it correctly? http://wikisend.com/download/456646/tt49.txt – BobNoobGuy Jun 02 '16 at 23:15
  • 1
    On Windows 10 64, it displays the 1s, but without line breaks. On my older Windows XP Notepad, I just get the gibberish. – idleherb Jun 03 '16 at 16:56
  • yea I think notepad does not understand 0A line feed. Notepad only understand CR LF which is 0D 0A.. thanks for opening and testing the file – BobNoobGuy Jun 03 '16 at 21:29