[wingide-users] Display Unicode strings in console?
support at wingware.com
Thu Mar 20 08:40:32 EDT 2014
Graham Wideman wrote:
> My understanding is that in python 3.x, (a) "the text", assuming it's a str, doesn't have a particular encoding (ie: particular byte representation). (b) when output via print(), Python queries the destination for the encoding that the destination wants, and encodes the string to that form. Hence different results when changing cmd.exe's code page using the chcp command. (Or changing WingIDE's Debug I/O encoding preference setting.)
Yes, under Python 3 all strings are internally stored as unicode. When
you print them they are converted to an encoding using whatever defaults
are set up by the environment.
However, minor clarification: When you set the Debug I/O encoding
preference in Wing it just tells Wing what encoding to expect to read
from its pipe to the debug process. We don't do anything to change the
environment of the debug process to cause it to spit out a different
encoding, as chcp does.
Wingware | Python IDE
The Intelligent Development Environment for Python Programmers
More information about the wingide-users