subprocess stdin encoding

Jean-Paul Calderone exarkun at divmod.com
Mon Feb 5 09:06:22 EST 2007


On Mon, 05 Feb 2007 20:54:48 +0800, Thinker <thinker at branda.to> wrote:
> [snip]
>
>in site.py . and change if 0: to if 1: to enable string encoding.
>Now, you can execute python interpreter with LC_CTYPE='UTF-8'.
>

While this is sort of a correct answer to the question asked, it
isn't really a correct answer overall.  I hope no one actually
goes off and does this.  Doing so will result in completely
unportable code with very difficult to track down bugs.

Instead, use the str and unicode methods "encode" and "decode".

Jean-Paul



More information about the Python-list mailing list