PDA

View Full Version : Government Conspiracy



Halting
02-07-2006, 05:30 PM
For those of you using Windows, do the following:

1.) Open an empty notepad file
2.) Type "Bush hid the facts" (without the quotes)
3.) Save it as whatever you want.
4.) Close it, and re-open it.

Its a government conspiracy!

Craig
02-07-2006, 05:31 PM
Dave aka PostgreSQL showed me this:P

RedStratocas
02-07-2006, 05:32 PM
Thats so weird....

cassiee
02-07-2006, 05:37 PM
i dont get it?

clarr
02-07-2006, 05:37 PM
thats strange

Wayne
02-07-2006, 05:37 PM
Lol. Woah, that's kind of cool.

cassiee
02-07-2006, 05:39 PM
it comes up in chinese?
i dont get it

Halting
02-07-2006, 05:40 PM
It's unusual and it has been programmed into Notepad to do this obviously be a member of Microsoft or as my friend calls my company - Softcromic.

Oracle:
02-07-2006, 05:48 PM
Quite old really.

Over at WinCustomize (http://www.wincustomize.com/), someone thought (http://www.wincustomize.com/articles.aspx?SID=1&AID=117870&c=1) they'd found an Easter Egg in the Windows Notepad application. If you:


Open Notepad
Type the text "this app can break" (without quotes)
Save the file
Re-open the file in NotepadNotepad displays seemingly-random Chinese characters, or boxes if your default Notepad font doesn't support those characters.

It's not an Easter egg (even though it seems like a funny one), and as it turns out, Notepad writes the file correctly. It's only when Notepad reads the file back in that it seems to lose its mind.

But we can't even blame Notepad: it's a limitation of Windows itself, specifically the Windows function that Notepad uses to figure out if a text file is Unicode or not.

You see, text files containing Unicode (more correctly, UTF-16-encoded Unicode) are supposed to start with a "Byte-Order Mark" (BOM), which is a two-byte flag that tells a reader how the following UTF-16 data is encoded. Given that these two bytes are exceedingly unlikely to occur at the beginning of an ASCII text file, it's commonly used to tell whether a text file is encoded in UTF-16.

But plenty of applications don't bother writing this marker at the beginning of a UTF-16-encoded file. So what's an app like Notepad to do?

Windows helpfully provides a function called IsTextUnicode() (http://msdn.microsoft.com/library/en-us/intl/unicode_81np.asp?frame=true)--you pass it some data, and it tells you whether it's UTF-16-encoded or not.

Sorta.

It actually runs a couple of heuristics over the first 256 bytes of the data and provides its best guess. As it turns out, these tests aren't terribly reliable for very short ASCII strings that contain an even number of lower-case letters, like "this app can break", or more appropriately, "this api can break".

The documentation for IsTextUnicode (http://msdn.microsoft.com/library/en-us/intl/unicode_81np.asp?frame=true) says:



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 points to the ASCII string 0x41, 0x0A, 0x0D, 0x1D (A\n\r^Z), the string passes the IS_TEXT_UNICODE_STATISTICS test, though failure would be preferable.
Indeed.

As a wise man (http://www.everything2.com/index.pl?node=Tim%20Peters) once said, "In the face of ambiguity, refuse the temptation to guess. (http://www.python.org/doc/Humor.html#zen)"

http://apipes.blogspot.com/2006/06/this-api-can-break.html

Halting
02-07-2006, 05:50 PM
English please.

Oracle:
02-07-2006, 05:52 PM
English please.

It was an article on Digg which thought somebody had found a string which doesn't 'work' in Notepad but it's all explained, and no way a Government Conspiricy. Although quite funny.

clarr
02-07-2006, 05:55 PM
English please.
What he said fnx.
EternalMasque (Forum Moderator) Please don't post pointlessly.

Seatherny
02-07-2006, 08:33 PM
Lol weird

Want to hide these adverts? Register an account for free!