Hello Walter, > >I don't see that as a good solution, since every Python software > >that is internationalizaed will have do figure out this wrapping, > >introducing extra overhead unnecessarily. > > This wrapping is probably necessary for stateful encodings. If you > had a sys.stdout.encoding=="utf-16", print would probably add the > BOM every time a unicode object is printed. This doesn't happen if > you wrap sys.stdout in a StreamWriter. I'm not sure this is an issue for a terminal output stream, which is the case I'm trying to find a solution for. Otherwise, Python would already be in trouble for using this scheme in the print statement. Can you show an example of the print statement not working? -- Gustavo Niemeyer http://niemeyer.net
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