Re: encode() question

2007-08-06 Thread Omari Norman
On Tue, Jul 31, 2007 at 09:53:11AM -0700, 7stud wrote: > s1 = "hello" > s2 = s1.encode("utf-8") > > s1 = "an accented 'e': \xc3\xa9" > s2 = s1.encode("utf-8") > > The last line produces the error: > > --- > Traceback (most recent call last): > File "test1.py", line 6, in ? > s2 = s1.encode

Re: encode() question

2007-08-01 Thread Gabriel Genellina
En Tue, 31 Jul 2007 16:41:48 -0300, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> escribió: > On Tue, 31 Jul 2007 10:45:26 -0700, 7stud wrote: >> On Jul 31, 11:18 am, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: >>> str.decode and unicode.encode should NOT exist, or at least issue a >>> warn

Re: encode() question

2007-07-31 Thread Martin v. Löwis
>>> str.decode and unicode.encode should NOT exist, or at least issue a >>> warning (IMHO). >>> >> Yes, that sounds like a good idea. > > It sounds like horrible idea as those are the ones that are really needed. Correct. > One could argue about `str.encode` and `unicode.decode`. But there ar

Re: encode() question

2007-07-31 Thread Marc 'BlackJack' Rintsch
On Tue, 31 Jul 2007 10:45:26 -0700, 7stud wrote: > On Jul 31, 11:18 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> str.decode and unicode.encode should NOT exist, or at least issue a >> warning (IMHO). >> > > Yes, that sounds like a good idea. It sounds like horrible idea as those are

Re: encode() question

2007-07-31 Thread 7stud
On Jul 31, 11:18 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > str.decode and unicode.encode should NOT exist, or at least issue a > warning (IMHO). > Yes, that sounds like a good idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: encode() question

2007-07-31 Thread Gabriel Genellina
En Tue, 31 Jul 2007 13:53:11 -0300, 7stud <[EMAIL PROTECTED]> escribió: > s1 = "hello" > s2 = s1.encode("utf-8") > > s1 = "an accented 'e': \xc3\xa9" > s2 = s1.encode("utf-8") > > The last line produces the error: > > --- > Traceback (most recent call last): > File "test1.py", line 6, in ? >

encode() question

2007-07-31 Thread 7stud
s1 = "hello" s2 = s1.encode("utf-8") s1 = "an accented 'e': \xc3\xa9" s2 = s1.encode("utf-8") The last line produces the error: --- Traceback (most recent call last): File "test1.py", line 6, in ? s2 = s1.encode("utf-8") UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position