Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Resaving through Notepad.
#1
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.
Reply
#2
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
Reply
#3
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.
Reply
#4
Just for the record: Even with wordwrap off, notepad still appears to corrupt binary files. (I tested it on a .png)


Quote:Comparing files hm.png and hm2.png
****** hm.png


[Eªª*cf¤”RêÝœ(RU¥”*Ë?Öz~þú-yž?ÛÊ|XÀ²Êfk~½ûèXd+îõëòJ)×]úõ;ÏsYEËÜ¢.p÷åsG%Öùqí{›¯ÏåI©­rVÔ2§R*Ê#÷zj‡ÝGwç“v×ÅW_IwÛ`ß±/Ÿo’[óx¥*©GÏ
****** hm2.png

IHDR ž å -Ù. âIDATxÚíMz›:†EöqŸ»‚àÄÝA³‚–‘=c &ÃÎÂ,¹wíê®Àd)YwpREA$ƒÅßûü`ôé=ÆQy>©¿J6ÛªRÏåé&Ù6?£H™…­J’
[Eªª*cf¤”RêÝœ(RU¥”*Ë?Öz~þú-yž?ÛÊ|XÀ²Êfk~½ûèXd+îõëòJ)×]úõ;ÏsYEËÜ¢.p÷åsG%Öùqí{›¯ÏåI©­rVÔ2§R*Ê#÷zj‡ÝGwç“v×ÅW_IwÛ`ß±/Ÿo’[óx¥*©GÏ
******

****** hm.png
ÖªPË2"×"r-¹jÔ"¨…Z¨³â)S+x7â^ͺsÇÝ6º»Í !÷ªÿËÝɵS’kÔ"¨]ð©Ô’kɵˆ\‹µäZ¨%×B-ÔB-Ô¬©_CnÊú„wχÑû?µÒ‹Œ ×öÿ ¹j¡j¡j¡–±ò*
©e¬L®…Zr-Ô’k¡–\» jÇò\Ê3âÍOQÿiùìŸkeWÛö¶ûó²ý¿¶®û끹Ð
ˆ\‹µk£6䯬 vN©jÔ"¨EP‹µP µj׎¦®kÈÖ÷…{)Ø…Yë†ÚöÜËÅý[u
«ò\ZÛjð>÷éÚ=Í;×.ò~'gÈP µj¡j¡j¡j¡j¡A-Ô®x¨žhÝcëãÔË{!H›‚=Mµë¹k¡jÔ"¨EP‹ k¡k¡jQ8s9ÛeÍ7µùm}gÑÞvãþ.&3È%›äJ1/ª¢¦7mϝ
****** hm2.png
ÖªPË2"×"r-¹jÔ"¨…Z¨³â)S+x7â^ͺsÇÝ6º»Í !÷ªÿËÝɵS’kÔ"¨]ð©Ô’kɵˆ\‹µäZ¨%×B-ÔB-Ô¬©_CnÊú„wχÑû?µÒ‹Œ ×öÿ ¹j¡j¡j¡–±ò*
©e¬L®…Zr-Ô’k¡–\» jÇò\Ê3âÍOQÿiùìŸkeWÛö¶ûó²ý¿¶®û끹Рµˆ\‹ A-‚ZµP‹ A-‚Zµj±j¡A-‚Zµj±j¡A-‚ZµÈGñ2¨å7?~ÖNó4Võ|LñTLóUɵ
ˆ\‹µk£6䯬 vN©jÔ"¨EP‹µP µj׎¦®kÈÖ÷…{)Ø…Yë†ÚöÜËÅý[u jaqÖ{µdk§y)Ø^A-ÔB-ÔB-ÔB-ÖB-ÖB-ÔB-ÔB-ÔN—Ú>ïðžòµõæ~Žþ¼qµÃ¶ÿëíþ/xŸ`ô›æ
«ò\ZÛjð>÷éÚ=Í;×.ò~'gÈP µj¡j¡j¡j¡j¡A-Ô®x¨žhÝcëãÔË{!H›‚=Mµë¹k¡jÔ"¨EP‹ k¡k¡jQ8s9ÛeÍ7µùm}gÑÞvãþ.&3È%›äJ1/ª¢¦7mϝ
******

****** hm.png
åwÀÚ*ÍYóXºZ›ñ͵ŽG3„¬:׊gÅSÑÆ„NZ^}¿£Â¦+Ö~S‹çmƒ ¾½p-ãZ=ÝlñZWÈvYÛ#p5ÏÌÈlÖf¢lN7ÇÙf\q9¢ZmÖ 2Š¢Ãáp:Ê² FíznÈ„|=ðËË ãZƵ\š
¹â6œ¯¤‡ï4ú2©EX‹°a-Ö"¬EX‹°a-ÂÚ5ëgÉÒPýÈ
****** hm2.png
åwÀÚ*ÍYóXºZ›ñ͵ŽG3„¬:׊gÅSÑÆ„NZ^}¿£Â¦+Ö~S‹çmƒ ¾½p-ãZ=ÝlñZWÈvYÛ#p5ÏÌÈlÖf¢lN7ÇÙf\q9¢ZmÖ 2Š¢Ãáp:Ê² FíznÈ„|=ðËË ãZƵ\š
¹â6œ¯¤‡ï4ú2©EX‹°a-Ö"¬EX‹°a-ÂÚ5ëgÉÒPýÈ IEND®B`‚
******
Reply
#5
some little offtopic old news, maybe, maybe-not:
http://www.digg.com/software/_this_app_c...n_Notepad_
ammit potato!
Reply
#6
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.. Smile It doesn't work. The Windows edit control is designed for editing text, not binary data.
Reply
#7
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
Reply
#8
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.
Reply
#9
I see... so the BOM isn't a standard then... or...? (damn getting off-topic >.>)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)