On 8/26/10 1:25 PM, Navkirat Singh wrote:

On 26-Aug-2010, at 11:01 PM, John Bokma wrote:

Navkirat Singh<navkir...@gmail.com>  writes:

Hey guys,

I am programming a webserver, I receive a jpeg file with the POST
method.The file (.jpeg) is encoded in bytes, I parse the bytes by
decoding them to a string.

Why?

--
John Bokma                                                               j3b

Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl&  Python Development: http://castleamber.com/
--
http://mail.python.org/mailman/listinfo/python-list

why? I am not quite sure what you have not understood.

Why decode the bytes to (presumably) unicode strings just to encode them back to bytes again? JPEG is not composed of unicode characters; you need to leave them as bytes.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to