Python 3.0 uses utf-8 encoding, but os.system() when running on Windows uses the system default encoding, which may be "cp936" or "mbcs". They are incompatible.
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.
A note about reproducing: since Windows 2000 all language packs can be installed easily using the Regional Options in the Control Panel. Even on an English version of Windows, character set mappings and fonts of other languages can be installed.
Python 3.0 has many more problems at its boundaries to the system on Windows. Large parts of the API that deals with Windows system calls have to be rewritten in order to use the wide char API.
Note that the final .encode("cp936") is now invalid: os.system accepts unicode strings, not bytes: >>> os.system(("echo " + sys.stdin.readline().rstrip("\n"))) Corrected as r59065.