[Python-bugs-list] [ python-Bugs-774536 ] UnicodeError

SourceForge.net noreply@sourceforge.net
Sun, 20 Jul 2003 14:12:24 -0700


Bugs item #774536, was opened at 2003-07-20 13:59
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=774536&group_id=5470

Category: IDLE
Group: Python 2.2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Michael Peternell (mpeti)
Assigned to: Nobody/Anonymous (nobody)
Summary: UnicodeError

Initial Comment:
>>> c = "Österreich"
UnicodeError: ASCII encoding error: ordinal not in
range(128)

the parser must not consider the German language an error.
the same for French:

>>> c = "Kate Ryan - Désenchantée"
UnicodeError: ASCII encoding error: ordinal not in
range(128)

I think this behavior was INTENDED, or why did the
error message say "ordinal not in range(128)"? This is
not an error. It is intended that bytes have 8 bits and
not 7.

I hope you don't reject this bug.

Michael

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-07-20 23:12

Message:
Logged In: YES 
user_id=21627

As Marc-Andre explains, this bug is fixed in Python 2.3.

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2003-07-20 18:17

Message:
Logged In: YES 
user_id=38388

Ah, so it's an IDLE problem, not a Python one. AFAIK, IDLE
behaves
much better wir to Unicode in the version that comes with
Python 2.3.

----------------------------------------------------------------------

Comment By: Michael Peternell (mpeti)
Date: 2003-07-20 18:03

Message:
Logged In: YES 
user_id=809932

Hi lemburg,

no, I haven't. It seems the problem only exists on Windows.
I am using Windows XP. Look at this URL:
http://www.python.org/doc/current/tut/node5.html (Chapter
3.1.3): "...The default encoding is normally set to ASCII,
which passes through characters in the range 0 to 127 and
rejects any other characters with an error. ..."
But they are writing strings in the form u"blabla". Maybe
Windows converts everything to Unicode automatically?
But thank you anyways. The problem only exists with 2.2.3
and only with Idle. The Dos-Version (python.exe) works
proplerly. I've downloaded python 2.3c1 now and everything
works fine.
But it isn't perfect anyways...

>>> x = "Österreich"
>>> x
'\xd6sterreich'
>>> print x
Österreich
>>> "ńń"
'\xf1\xf1'

'\xd6' doesn't look very nice, but as long as you can print
it, it's not a big problem. and it can parse char(0xf1) (or
Alt-164, which equals 0xa4) too.

Michael

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2003-07-20 16:15

Message:
Logged In: YES 
user_id=38388

Are you sure about this ?

/home/lemburg> python2.2
Python 2.2.3 (#1, Jul  1 2003, 10:54:49) 
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.

>>> c = "Österreich"
>>> 

Same for Python 2.3.

Perhaps you have change something in your site.py file ?!


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=774536&group_id=5470