[Python-bugs-list] [ python-Bugs-788457 ] Cannot decode/encode anything!

SourceForge.net noreply at sourceforge.net
Mon Aug 18 01:35:34 EDT 2003


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

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Joe Smith (zarxos)
Assigned to: Nobody/Anonymous (nobody)
Summary: Cannot decode/encode anything!

Initial Comment:
Whenever I use any of the decode methods in the codecs
package, or use a string's encode or decode method, I
get the error: UnicodeDecodeError: 'ascii' codec can't
decode byte 0x88 in position 0: ordinal not in
range(128). That character it's referring to is a ê (e
with circonflex if you can't see it for whatever
reason). I don't know why this is happening, and I've
tried a dozen different ways to try and get it to work.
Please fix this horrible bug! I can't decode any files! 

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

Comment By: Christos Georgiou (tzot)
Date: 2003-08-18 10:35

Message:
Logged In: YES 
user_id=539787

Joe, does this code work for you?

s = '\x88'
u = s.decode('cp850')

If it does work fine, then either you don't supply the 
<encoding> argument to decode/encode, or you try to print 
the result; in either of these two cases, it's not a Python bug.

PS Since e-circumflex is \x88 for you, I assume you run this in 
the Python command line.

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

Comment By: Christos Georgiou (tzot)
Date: 2003-08-18 10:34

Message:
Logged In: YES 
user_id=539787

Joe, does this code work for you?

s = '\x88'
u = s.decode('cp850')

If it does work fine, then either you don't supply the 
<encoding> argument to decode/encode, or you try to print 
the result; in either of these two cases, it's not a Python bug.

PS Since e-circumflex is \x88 for you, I assume you run this in 
the Python command line.

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

Comment By: M.-A. Lemburg (lemburg)
Date: 2003-08-14 11:17

Message:
Logged In: YES 
user_id=38388

The ASCII codec can't handle non-ASCII characters
and that's perfectly normal. Please provide more
context.

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

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



More information about the Python-bugs-list mailing list