diff -r 13307eb5bf47 Lib/idlelib/rpc.py --- a/Lib/idlelib/rpc.py Sat Apr 14 14:20:29 2012 -0500 +++ b/Lib/idlelib/rpc.py Mon Apr 16 20:08:12 2012 +0300 @@ -615,10 +615,8 @@ try: sys.stdout.write(text) except UnicodeEncodeError: - # let's use ascii while utf8-bmp codec doesn't present - encoding = 'ascii' - bytes = text.encode(encoding, 'backslashreplace') - text = bytes.decode(encoding, 'strict') + # escape non-BMP characters + text = ''.join(c if ord(c) <= 0xffff else '\\U%08x' % ord(c) for c in text) sys.stdout.write(text) sys.stdout.write("\n") builtins._ = value