Saturday, October 14, 2006

A conspiracy or just a bug?

My son showed me that if you save a text file containing the sentence "bush hid the facts" (typed exactly like that, without the quotes), and then open it in Windows Notepad, all you see is a row of 9 rectangles. At first glance this looks like an "Easter egg", a surprise planted by programmers, like the flight simulator game in Excel 97. But hiding Easter eggs in a Microsoft program will get you fired these days.

It turns out that the explanation is more mundane, and there are many sentences that will do this to Notepad. It's all explained (to programmers, anyway) at:

What's really happening here is that Notepad examines every text file it opens to see if it was written in Chinese (or some other non-Roman alphabet). But text files don't actually contain anything besides the text -- certainly nothing that could indicate the language or font used. So Notepad simply assumes that if the order of bits in the file matches a string of Chinese characters, then that's what it must be. And if Notepad isn't configured to display Chinese, it displays a rectangle instead of each Chinese character.

Besides "bush hid the facts", here are some other sentences that behave this way in Notepad.

"this app can break"
"What are you doing"
"Matrix can not lie"
"Osamabin laden leading all terrorist"

and my favourite,

"We can blast Microsoft for a new bug"

If you're observant, you'll notice that there are exactly half as many rectangles as the number of letters in the English message Notepad should be showing. You can even make up your own messages that break Notepad -- if you can understand the instructions at the blog post linked above.

No comments: