This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r_mosaic
Recipients r_mosaic
Date 2007-09-24.06:21:49
SpamBayes Score 0.023841651
Marked as misclassified No
Message-id <1190614910.6.0.665355811077.issue1193@psf.upfronthosting.co.za>
In-reply-to
Content
Steps to reproduce:

1. Use a Windows, with system default encoding to cp936 (Chinese PRC, or
Simplified Chinese) in Regional Options.
2. Open Python 3.0 (command line).
3. Type:
import os
import sys
os.system(("echo " + sys.stdin.readline().rstrip("\n")).encode("cp936"))
(in stdin type:)
我

Result:
The output from "echo" would be utf-8 mistakenly used as cp936:
鎴?

Expected result:
The "echo" command outputs "我".

Comments:
I guess os.system can recoding the string before sending the string out.
This may be done in the C part of Python. BTW, The os.popen() function 
is
correct.
History
Date User Action Args
2007-09-24 06:21:51r_mosaicsetspambayes_score: 0.0238417 -> 0.023841651
recipients: + r_mosaic
2007-09-24 06:21:50r_mosaicsetspambayes_score: 0.0238417 -> 0.0238417
messageid: <1190614910.6.0.665355811077.issue1193@psf.upfronthosting.co.za>
2007-09-24 06:21:50r_mosaiclinkissue1193 messages
2007-09-24 06:21:49r_mosaiccreate