Notepad Bug

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. 

One thought on “Notepad Bug

Leave a Reply

Your email address will not be published. Required fields are marked *