[prev in list] [next in list] [prev in thread] [next in thread]
List: python-bugs-list
Subject: [Python-bugs-list] [ python-Bugs-788457 ] Cannot decode/encode
From: noreply () sourceforge ! net (SourceForge ! net)
Date: 2003-08-29 23:08:56
Message-ID: E19sw6e-00074V-00 () sc8-sf-web1 ! sourceforge ! net
[Download RAW message or body]
Bugs item #788457, was opened at 2003-08-13 20:07
Message generated for change (Settings changed) made by rhettinger
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: Closed
>Resolution: Invalid
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: Joe Smith (zarxos)
Date: 2003-08-18 19:50
Message:
Logged In: YES
user_id=826905
Yes I am using Python command line. What else would I use?
Anyway, your method works too, but someone told me to put
u"?".encode('cp437') in my code and that works. Thank you
anyway.
----------------------------------------------------------------------
Comment By: Christos Georgiou (tzot)
Date: 2003-08-18 02:41
Message:
Logged In: YES
user_id=539787
Forgive my multiple posting (SF reported an error), and
substitute "Windows command line" for "Python command line"
in the last paragraph.
----------------------------------------------------------------------
Comment By: Christos Georgiou (tzot)
Date: 2003-08-18 02:39
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 02: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 02: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 03: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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic