Skip to content

Assignment 1 for Windows #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
johnrevans6 opened this issue Sep 3, 2016 · 0 comments
Open

Assignment 1 for Windows #51

johnrevans6 opened this issue Sep 3, 2016 · 0 comments

Comments

@johnrevans6
Copy link

I'm putting this here for posterity. No real action required.

Issue Summary:
Windows users not using the course's image may encounter an infuriatingly frustrating issue if they out their file using the command:

python twitterstream.py > output.txt

This defaults the encoding Windows-1252 and the output looks something like:

This will inevitably cause JSON parsing to fail.

Solution:

In Powershell, pipe in Out-File and force UTF-8. So something like:

python twitterstream.py | Out-File -Encoding "UTF8" output.txt

In command prompt, you actually need to convert the default encoding temporarily:

chcp 65001

Then run the command as normal. Then convert back:

chcp 1252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant