Re: Re: Re: UTF-8 problem encoding and decoding in Python3

2010-10-14 Thread hidura
Finally did it, thank you all for your help, the code i will upload because can be used by Python 3 for handle the wsgi issue of the Bytes! Almar, sorry for the mails gmails sometimes sucks!! On Oct 14, 2010 1:00pm, hid...@gmail.com wrote: Finally did it, thank you all for your help, the code i

Re: UTF-8 problem encoding and decoding in Python3

2010-10-12 Thread Almar Klein
>So if you can, you could make sure to send the file as just bytes, >>or if it must be a string, base64 encoded. If this is not possible >>you can try the code below to obtain the bytes, not a very fast >>solution, but it should work (Python 3): >> >> >>MAP = {} >>for i in r

Re: UTF-8 problem encoding and decoding in Python3

2010-10-12 Thread MRAB
On 12/10/2010 15:45, Hidura wrote: Don't work this is the error what give me TypeError: sequence item 0: expected bytes, str found, i continue trying to figure out how resolve it if you have another idea please tellme, but thanks anyway!!! On Mon, Oct 11, 2010 at 4:27 AM, Almar Klein mailto:alma

Re: UTF-8 problem encoding and decoding in Python3

2010-10-12 Thread Hidura
Don't work this is the error what give me TypeError: sequence item 0: expected bytes, str found, i continue trying to figure out how resolve it if you have another idea please tellme, but thanks anyway!!! On Mon, Oct 11, 2010 at 4:27 AM, Almar Klein wrote: > > On 10 October 2010 23:01, Hidura w

Re: UTF-8 problem encoding and decoding in Python3

2010-10-11 Thread Almar Klein
On 10 October 2010 23:01, Hidura wrote: > I try to encode a binary file what was upload to a server and is > extract from the wsgi.input of the environ and comes as an unicode > string. > Firstly, UTF-8 is not meant to encode arbitrary binary data. But I guess you could have a Unicode string in

Re: UTF-8 problem encoding and decoding in Python3

2010-10-10 Thread Hidura
I try to encode a binary file what was upload to a server and is extract from the wsgi.input of the environ and comes as an unicode string. 2010/10/10, Almar Klein : > Hi, > > please tell us what you are trying to do. Encoding (with UTF-8) is a method > to convert a Unicode string to a sequence of

Re: UTF-8 problem encoding and decoding in Python3

2010-10-10 Thread Almar Klein
Hi, please tell us what you are trying to do. Encoding (with UTF-8) is a method to convert a Unicode string to a sequence of bytes. Decoding does the reverse. When i open > directly and try to decode the file the error is this: `UnicodeDecodeError: > 'utf8' codec can't decode byte 0xff in positi

Re: UTF-8 problem encoding and decoding in Python3

2010-10-10 Thread Chris Rebert
On Sun, Oct 10, 2010 at 10:25 AM, wrote: > Hello everybody i am trying to encode a file string of an upload file and i > am facing some problems with the first part of the file. When i open > directly and try to decode the file the error is this: `UnicodeDecodeError: > 'utf8' codec can't decode b

UTF-8 problem encoding and decoding in Python3

2010-10-10 Thread hidura
Hello everybody i am trying to encode a file string of an upload file and i am facing some problems with the first part of the file. When i open directly and try to decode the file the error is this: `UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: unexpected code byt