Bush Hid The Facts - Workarounds

Workarounds

Editing the text to not be a pattern that triggers this bug will fix it. For instance, adding a new line in the first 20 characters will work.

If the file is saved as "UTF-8" rather than "ANSI" (which in reality means Windows-1252 on systems using western European languages) the text displays correctly, because Notepad prepends a byte order mark as a non-standard UTF-8 flag, which is a different pattern that does not trigger this bug. UTF-8 without the byte order mark would still trigger the bug, as this sequence is represented identically in UTF-8 as in ASCII.

The bug is also avoided by saving as "Unicode", which in Microsoft Windows usually means UTF-16LE.

To retrieve the original text using Notepad, bring up the "Open a file" dialog box, select the file, select "ANSI" or "UTF-8" in the "Encoding" list box, and click Open. (Under Windows 2000, Notepad lacks the "Encoding" list box. Notepad2 makes the same error (by trusting IsTextUnicode), and also lacks an option to override encoding when opening a file. However, WordPad opens the text file correctly by default.)

Read more about this topic:  Bush Hid The Facts