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 donut
Recipients
Date 2004-06-07.07:00:09
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
In python2.3 printing unicode to an appropriate terminal
actually works.  But using sys.stdout.write doesn't.

Ex:
Python 2.3.4 (#2, May 29 2004, 03:31:27) 
[GCC 3.3.3 (Debian 20040417)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> sys.stdout.encoding
'UTF-8'
>>> u=u'\u3053\u3093\u306b\u3061\u308f'
>>> print u
S“ka
>>> sys.stdout.write(u)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode
characters in position 0-4: ordinal not in range(128)


The file object docs say:
"encoding
    The encoding that this file uses. When Unicode
strings are written to
    a file, they will be converted to byte strings
using this encoding.
    ..."
Which indicates to me that it is supposed to work.
History
Date User Action Args
2007-08-23 14:22:15adminlinkissue967986 messages
2007-08-23 14:22:15admincreate