[New-bugs-announce] [issue2998] UnicodeEncodeError: 'ascii' codec can't encode character

Rahman report at bugs.python.org
Thu May 29 09:58:43 CEST 2008


New submission from Rahman <muallim-i_ali at hotmail.com>:

Hi i Rahman Yazgan. I live in Turkey. I am pyhton(pyqt) programmer.

I found a bug :

UnicodeEncodeError: 'ascii' codec can't encode character

QLineEdit.text(),... UnicodeEncodeError so ascii codecs, can't encoding.

python version 2.5(windows)  python25/lib/site.py line 381-383 :

    if encoding != "ascii":
        # On Non-Unicode builds this will raise an AttributeError...
        sys.setdefaultencoding(encoding) # Needs Python Unicode build !

UnicodeEncodeError: 'ascii' codec can't encode character so resoluble:

    if encoding != "ascii":
        # On Non-Unicode builds this will raise an AttributeError...
        sys.setdefaultencoding(encoding) # Needs Python Unicode build !

    if encoding == "ascii":
        sys.setdefaultencoding("utf-8")

----------
components: Unicode
files: site.py
messages: 67478
nosy: Muallim-i Âli
severity: normal
status: open
title: UnicodeEncodeError: 'ascii' codec can't encode character
versions: Python 2.5
Added file: http://bugs.python.org/file10462/site.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2998>
_______________________________________


More information about the New-bugs-announce mailing list