Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #20066
| Date | 2012-02-09 05:19 -0600 |
|---|---|
| From | Andrew Berg <bahamutzero8825@gmail.com> |
| Subject | Re: unicode printing on Windows |
| References | <4f625c3f-77b0-410a-ad63-4acd1a6f1f44@hs8g2000vbb.googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5579.1328786372.27778.python-list@python.org> (permalink) |
On 2/9/2012 4:46 AM, BlueBird wrote: > Does anybody know how to fix problem 1 ? That way, I could at least > deal with programs that print UTF8 on stdout. I'm pretty sure there isn't a way. cp65001 is supposed to be UTF-8, but it doesn't work in my experience (I fed it some UTF-8 demo text and I got garbage and beeping). Python 3.3 will support cp65001, 3.2 and below do not. > Regarding point 2, I must admit even when I am the author of the > program, printing debug information (in unicode) on the stdout is a > really really tricky thing. Is there a recommendation on how to do > that properly ? Use the logging module, perhaps? It has handled encoding issues automatically, at least in my experience. In Python 3, you can convert a string to bytes from one encoding, then convert to another encoding, but Python 2 has things set up very differently (and my experience is with py3k, so I can't help much). -- CPython 3.2.2 | Windows NT 6.1.7601.17640
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
unicode printing on Windows BlueBird <phil@freehackers.org> - 2012-02-09 02:46 -0800 Re: unicode printing on Windows Andrew Berg <bahamutzero8825@gmail.com> - 2012-02-09 05:19 -0600 Re: unicode printing on Windows Terry Reedy <tjreedy@udel.edu> - 2012-02-09 13:21 -0500
csiph-web