Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#386 Console should support UTF-8

closed-fixed
nobody
None
5
2008-04-07
2006-10-19
Martin v. Löwis
No

The PyDev console window should support UTF-8 output.

To find out whether it works, do

print u"Martin v. L\xF6wis"

in a script. This currently gives the error

print u"Martin v. L\xF6wis"
UnicodeEncodeError: 'ascii' codec can't encode
character u'\xf6' in position 11: ordinal not in range(128)

This, in turn, is due to sys.stdout.encoding being
None. It should be set to UTF-8 (IMO, or to the Eclipse
default encoding, whereever that comes from), and
decode all incoming bytes from that encoding. Likewise
for sys.stdin.encoding.

Discussion

<< < 1 2 (Page 2 of 2)
  • Fabio Zadrozny
    Fabio Zadrozny
    2007-06-19

    Logged In: YES
    user_id=617340
    Originator: NO

    Changing to bug...

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2008-04-07

    • status: open --> closed-fixed
     
  • Fabio Zadrozny
    Fabio Zadrozny
    2008-04-07

    Logged In: YES
    user_id=617340
    Originator: NO

    Fixed for 1.3.15

    The final solution was using creating a 'sitecustomize.py' which is always added to the pythonpath as the 1st path (and then removed to execute a 'sitecustomize.py' that may be defined by the user).

    At this module, the 'sys.setdefaultencoding' can be used, as it's imported just before that method is deleted.
    It can be seen at: http://pydev.cvs.sourceforge.net/pydev/org.python.pydev/PySrc/pydev_sitecustomize/

     
<< < 1 2 (Page 2 of 2)