Ex17 test file looks strange

Just curious - per the lesson I echo to the test.txt file this string: “This is a test file”.
But when I view the file in Atom, it looks this way: ??T h i s i s a t e s t f i l e".

I just looked at the file with another text editor, and it looks normal, so this is something that Atom does.

This is because of echo command in Windows. Just don’t use it in this case.

Windows echo will internationalize your file (using whatever codec your computer is using), even if PowerShell has no idea what’s inside it. It’s incredibly dumb that PowerShell doesn’t do native UTF-8 and chardet detection, but that’s what you have. Just delete the file and make it again with Atom and make sure that it’s ASCII to keep things simple.

1 Like