You need to make sure your file is a plain text and not a rich text file. Go to Format and select Make Plain Text. Also go to TextEdit and select Preferences. In the Format section find New Document and make sure Plain Text is checked. In the Options make sure Smart Quotes is unchecked. In the Open and Save tab make sure Display HTML files as HTML code instead of formatted text is unchecked. Go to if you need more help.