Bush hid the facts
||The topic of this article may not meet Wikipedia's general notability guideline. (September 2016) (Learn how and when to remove this template message)|
|This article needs additional citations for verification. (September 2016) (Learn how and when to remove this template message)|
Bush hid the facts is a common name for a bug present in some Microsoft Windows applications, which causes a file of text encoded in ASCII or its superset (such as in a Windows code page) to be interpreted as if it were UTF-16LE, resulting in mojibake. When "Bush hid the facts" (without newline or quotes) is put in a new (pre-Vista) Notepad document and saved, closed, and reopened, the nonsensical Chinese characters "畂桳栠摩琠敨映捡獴" appear instead.
While "Bush hid the facts" is the sentence most commonly presented on the Internet to induce the error, the bug can be triggered by many sentences with characters and spaces in a particular order so that the bytes match the UTF-16LE encoding of valid (if nonsensical) Chinese Unicode characters. Other popular strings are "this app can break", "acre vai pra globo" (Portuguese for "Acre goes to Rede Globo"), and "aaaa aaa aaa aaaaa". The bug is triggered even by the text "a ".
The bug occurs when the string is passed to the Win32 charset detection function IsTextUnicode with no other characters. IsTextUnicode sees what it thinks is valid UTF-16LE Chinese and returns true, and the application then incorrectly interprets the text as UTF-16LE.
The bug had existed since IsTextUnicode was introduced with Windows NT 3.5 in 1994, but was not discovered until early 2004. Many text editors and tools exhibit this behavior on Windows because they use IsTextUnicode as well.
Several workarounds exist for this bug:
- Editing the text to not be a pattern that triggers this bug will avoid 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" the text loads correctly, because Notepad prepends a UTF-8 byte order mark, which is a pattern that does not trigger the 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 means UTF-16LE. When loading this text IsTextUnicode should (and does) return true and the text is correct.
- 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 also lacks this. WordPad appears to load the text correctly without choosing the encoding, since it uses its own encoding detection.
- Christensen, Brett M. (November 2, 2009). "Bush Hid The Facts - Notepad Conspiracy Claim". Hoax Slayer.
- Chen, Raymond (March 24, 2007). "Some files come up strange in Notepad - The Old New Thing". blogs.msdn.com.
- Cumps, David (February 27, 2004). "Notepad bug? Encoding issue?". #region .Net Blog. Retrieved February 15, 2009.