Dongying Zhang <zhangdongying1...@gmail.com> added the comment: Hello R. David Murray:
Thanks for your care. The examples I given both in message and file is just the same. You got the 'UnicodeEncodeError' because your system default encoding is ascii. The declaration of encoding at the top didn't help with this situation. To solve this, you can add following lines at the import part of the codes. ===================================================================== import sys reload(sys) sys.setdefaultencoding('utf-8') ===================================================================== Then it should work by executing it directly or in a terminal (but not in IDLE). You can try the new file I submit. Thanks! ---------- Added file: http://bugs.python.org/file16446/utf8_test.py _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8054> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com