<story><title>Man who thought opening a TXT file is fine thought wrong</title><url>https://www.paulosyibelo.com/2021/04/this-man-thought-opening-txt-file-is.html</url></story><parent_chain><item><author>userbinator</author><text>Two words: excessive complexity.&lt;p&gt;It&amp;#x27;s always seemed strange that an application called TextEdit is actually more than a text editor. I strongly believe that content-type autodetection, much less HTML rendering(!), most certainly does not belong in a text editor.</text></item></parent_chain><comment><author>13of40</author><text>Here&amp;#x27;s an interesting quirk in Windows: There are two APIs to execute external programs, CreateProcess and ShellExecute.  CreateProcess is the older of the two and only runs executables.  ShellExecute opens the target with whatever app is associated with the extension.&lt;p&gt;When they shoehorned the ShellExecute behavior into cmd.exe, they basically just said &amp;quot;if (!CreateProcess(foo)) {ShellExecute (foo)}&amp;quot;&lt;p&gt;As a result, if you take &amp;quot;foo.exe&amp;quot; and rename it &amp;quot;foo.txt&amp;quot; then try to run it like &amp;quot;C:\&amp;gt;foo.txt&amp;quot; from the command line, it will run as an executable instead of opening in Notepad like you would expect.  Do the same with a real text file (that doesn&amp;#x27;t start with &amp;quot;MZ&amp;quot;) and it opens in Notepad.</text></comment>
<story><title>Man who thought opening a TXT file is fine thought wrong</title><url>https://www.paulosyibelo.com/2021/04/this-man-thought-opening-txt-file-is.html</url></story><parent_chain><item><author>userbinator</author><text>Two words: excessive complexity.&lt;p&gt;It&amp;#x27;s always seemed strange that an application called TextEdit is actually more than a text editor. I strongly believe that content-type autodetection, much less HTML rendering(!), most certainly does not belong in a text editor.</text></item></parent_chain><comment><author>Wowfunhappy</author><text>Text ≠ Plain Text. TextEdit defaults to rtf. It supports html as an alternative to rtf, which is to say it can do basic formatting and nothing else.&lt;p&gt;It&amp;#x27;s perfectly reasonable to expect a text editor to support more than literal unicode, and to work with a variety of commonly-used formats.</text></comment>