Help - Search - Members
Full Version: How to trick notepad
Piriform Community Forums > Computer Help and Discussion > The Lounge
Humpty
Found this quirk below while surfing.

Notepad displayed squares instead of the text on my machine. smile.gif

This actually works. It will not crash your computer, it just breaks Notepad in that it causes it to display very oddly. No perm damage comes of the following steps.

Here's how to do it:
1. Open up Notepad (not Wordpad, not Word or any other word processor)
2. Type in this sentence exactly (without quotes): "this app can break"
3. Save the file to your hard drive.
4. Close Notepad
5. Open the saved file by double clicking it.

Instead of seeing your sentence, you should see a series of squares. For whatever reason, Notepad can't figure out what to do with that series of characters and breaks.

Link to discussion
oli
weird
Humpty
Apparently the same quirk is in Metapad and Notepad2. huh.gif
Tarun
It's because it saves as ascii and not unicode.
DjLizard
No, something about that phrase is tricking it into saving it as Unicode instead of ASCII.

Make two text files, one with the exact phrase, and another with the phrase missing one word... then view both with a hex editor. It's a bug.
Tarun
QUOTE(DjLizard @ Jun 18 2006, 12:41 PM) [snapback]40790[/snapback]

No, something about that phrase is tricking it into saving it as Unicode instead of ASCII.

Make two text files, one with the exact phrase, and another with the phrase missing one word... then view both with a hex editor. It's a bug.

Ah, so that's what it was. Though it's not the phrase, it's something about the number of characters input. Cause it works with "Bush hid the facts" too.
DjLizard
It works with:
abcd efg hij klmno
too, so it's obviously not the content, but the number, like you said.
They're just putting a stupid phrase about breaking the app to make it seem more credible tongue.gif
DjLizard
From http://msdn.microsoft.com/library/default....nicode_81np.asp
:

QUOTE(MiKKKro$0ft)
The IS_TEXT_UNICODE_STATISTICS and IS_TEXT_UNICODE_REVERSE_STATISTICS tests use statistical analysis. These tests are not foolproof. The statistical tests assume certain amounts of variation between low and high bytes in a string, and some ASCII strings can slip through. For example, if lpBuffer indicates the ASCII string 0x41, 0x0A, 0x0D, 0x1D (A\n\r^Z), the string passes the IS_TEXT_UNICODE_STATISTICS test, although failure would be preferable.


ahahahahahah, so A\n\r^Z will make it fail too

and 4 3 3 5 causes the test to fail as well

It's a limitation of Windows itself (the API for IsTextUnicode()), not Notepad.
Spysnake
Just for creeps, type in "Bush hid the facts". Big brother is spying on us?
DjLizard
Yeah, that's what it is. It's definitely not an exploit of the Unicode "guessing" API.

It works with "abcd efg hij klmno" too. Conspiracy? I think so.
sonsie
hmmm...if it's about number and sequence of letters, then I'm guessing my quirk isn't related. Now and then when I open my homepage I get either those squares like you describe, or I get tons of symbols. I exit, wait 1 or 2 seconds, try again, and it's usually ok.

sonsie
DjLizard
What browser, what homepage? Not a whole lot of programs use the Unicode guessing API, just ones that have to deal with saving and opening unmarked content (and most websites are properly marked with UTF-8, etc).
sonsie
Hi DJ


QUOTE
What browser, what homepage? Not a whole lot of programs use the Unicode guessing API, just ones that have to deal with saving and opening unmarked content (and most websites are properly marked with UTF-8, etc).


Internet Explorer 6.0 and my home page is MSN.com

I have a picture of both errors I can put here - the squares and the symbols. This is probably really stupid, but I didn't know what if any info could be gotten out of what looks, to me anyway, like a mess, so I was hesitant to post it until I asked you. Is it ok to post them? and would they be helpful? Or do you know what I mean without seeing?

sonsie
DjLizard
Yep, I need to see it.
sonsie
[attachmentid=735][attachmentid=736]

Hope this works

sonsie

<sigh> why is everything so difficult

These were originally 370kb so I shrunk them. I thought you could click on them and enlarge, but I can't. Have no idea what to do

sonsie
DjLizard
Once you resize them, they're resized permanently. Start a new thread about this problem and post the full images, unresized. Save your screenshots as PNG in the future, they will be a lot smaller (even mspaint.exe can save PNG). A 1152x864 screenshot using PNG is only 134 KB for me.
sonsie
Screw it. Thanks for trying to help, Dj. But my limit for attachments on this site is 236 and I don't know of any way to shrink the screenshots. I've tried a few things, but everything makes them bigger. They're both over 350.

If it happens again - which it will eventually - I'll save the screenshots as png.

sonsie
DjLizard
That's what I'm saying - take the screenshots again as PNG, and they will fit under the limit.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.