Skip to content

Commit aa72b83

Browse files
committed
note to window users printing to command line
1 parent 7be6ca6 commit aa72b83

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,24 @@ api.get_everything(q='bitcoin')
5656
api.get_sources()
5757
```
5858

59+
#### For Windows users printing to _cmd_ or _powershell_
60+
You will encounter an error if you attempt to print the .json() object to the command line. This is because the '{', '}' curly braces to be printed to the console.
61+
This becomes especially annoying if developers wish to get 'under the hood'.
62+
63+
Here is the error:
64+
UnicodeEncodeError: 'charmap' codec can't encode character '\u2019' in position 1444: character maps to <undefined>
65+
66+
This can be fixed by:
67+
- installing 'win-unicode-console'
68+
`py -mpip install win-unicode-console`
69+
- then running it while calling your python script...
70+
`py -mrun myPythonScript.py`
71+
72+
Another option is hardcoding your console to only print in utf-8. This is a bad idea, as it could ruin many other scripts and/or make errors MUCH more difficult to track.
73+
[More information](https://stackoverflow.com/questions/5419/python-unicode-and-the-windows-console/32176732#32176732
74+
75+
5976
## Support
6077

6178
Feel free to make suggestions or provide feedback regarding the library. Thanks.
62-
Reach out at [lisivickmatt@gmail.com]('mailto:lisivickmatt@gmail.com')
79+
Reach out at [lisivickmatt@gmail.com]('mailto:lisivickmatt@gmail.com')

0 commit comments

Comments
 (0)