Posts: 1,556
Threads: 298
Joined: Dec 2002
I recently stumbled across a new one: When opening an image file in notepad, and then saving it again as the same file, it will no longer work correctly, despite containing the same data (or at least appearing to). Is there a way to get around this? It would help out in testing my Custom Resource File program, but if not, I'll probably live.
Probably not, because of the difference between ASCII and raw binary.
Makes no sense to me why you'd open it in notepad... You shoul dget a hex editor like XVI32
Posts: 3,368
Threads: 195
Joined: Jan 2003
Well, it helps to turn off word wrap before resaving, as that'll fill the file with <enter> chars.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 394
Threads: 16
Joined: Jun 2003
Posts: 1,439
Threads: 15
Joined: Apr 2003
That's due to the way Notepad detects if text is Unicode; with a short string of bytes like "this app can break", it can't make a very good guess and it sometimes guesses wrong.
As for editing binary files in Notepad, I've tried that before too..
It doesn't work. The Windows edit control is designed for editing text, not binary data.
Yeah, it was pretty amazing to read a link posted at that other link; Notepad basically "guesses" what kind of text is in the file, unicode or not, and when the string is very small, there's less context, so the guesses fail more often.
You'd think they could just add some sort of universal header to unicode txt files but no.... instead m$ has to write "statistical analysis" (guessing) engines. -.- lol
Posts: 1,439
Threads: 15
Joined: Apr 2003
Actually, there is such a header (the BOM - byte order mark), and Notepad always writes it when saving as Unicode. The problems begin when attempting to detect whether a file is Unicode when the BOM is not present.
I see... so the BOM isn't a standard then... or...? (damn getting off-topic >.>)