#3705: Command-line arguments were not correctly decoded when the

terminal does not use UTF8.

Now the code propagates the unicode string as far as possible, and avoids
the conversion to char* which implicitely uses utf-8.

Reviewed by Benjamin.
This commit is contained in:
Amaury Forgeot d'Arc 2008-11-11 23:04:59 +00:00
parent d3013ffa49
commit 9a5499b4e5
4 changed files with 35 additions and 25 deletions

View file

@ -135,6 +135,12 @@ class CmdLineTest(unittest.TestCase):
self.exit_code('-c', 'pass'),
0)
# Test handling of non-ascii data
command = "assert(ord('\xe9') == 0xe9)"
self.assertEqual(
self.exit_code('-c', command),
0)
def test_main():
test.support.run_unittest(CmdLineTest)