> You almost convinced me there, but I think this can > still be done > without changing the default encoding: simply reopen > stdout with a > different encoding. This is how Java does it. I/O > streams with an > encoding specified at open() are a very powerful > feature. You can > hide this in your $PYTHONSTARTUP. Good point, I'm happy with this. Make sure we specify it in the docs as the right way to do it. In an IDE, we'd have an Options screen somewhere for the output encoding. What the Java code I have seen does is to open a raw file and construct wrappers (InputStreamReader, OutputStreamWriter) around it to do an encoding conversion. This kind of obfuscates what is going on - Python just needs the extra argument. - Andy ===== Andy Robinson Robinson Analytics Ltd. ------------------ My opinions are the official policy of Robinson Analytics Ltd. They just vary from day to day. __________________________________________________ Do You Yahoo!? Bid and sell for free at http://auctions.yahoo.com
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4