Notepad Bug

June 28th, 2006

Google Blogoscoped pointed to a real cool Notepad Unicode Detection bug.

Try this. Create a new text file on your desktop, open it with Notepad, enter the following line (no return character)…

Bush hid the facts

… and save it. Close the file and open it again. You might now see some strange Chinese characters that don’t translate into anything meaningful, or boxes if you don’t have the Chinese font installed…

It also works with "this app can break". It seems to occur because Notepad thinks the file is a UTF-16 string. As it interprets it as multibyte Unicode (2 bytes per character), you get 8 characters.

It’s been reported that it works for any strings with the same length and where the spaces are in the same place. I tried the trick with "nnnn nnn nnn nnnnn" and it worked; so did "woah bob eat grass". Though for some reason, "woah cow eat grass" did not work. 

  1. The mystery of the zero byte image
  2. PHP UTF-8
  3. Merlin: A way to annoy visitors using Internet Explorer
  4. Encoding Javascript in a PNG through canvas
  5. More CAPTCHA WTF

One Response to “Notepad Bug”

  1. Vortechson 31 Dec 2006 at 9:43 pm

    it also works with ‘tony blair hid the facts’

Trackback URI | Comments RSS

Leave a Reply