When converting a byte array to a string (in .net) we have to do it using an
Encoding object. The Default (ANSI) encoding does the job in this case. It
works fine.
Thanks.


On Thu, May 14, 2009 at 4:19 AM, David Anderson <[email protected]>wrote:

>
> The file and string objects in Python 2.x doesn't apply any encoding.
> The string is the exact blob of bytes from the file. Unless you see an
> explicit call to .decode(), which would use a codec to transform the
> string into Unicode. But since we don't really care about the contents
> of what we're uploading, we just keep it as a plain byte blob.
>
> As for the specifications, it's just a plain HTTP POST, with the
> parameters you found in the Python implementation. It really is quite
> simple :-).
>
> - Dave
>
> On Wed, May 13, 2009 at 23:23, Adrian Aisemberg
> <[email protected]> wrote:
> > I have rewritten the python uploader in C#.
> > Trying to send a text file works 100%.
> > I'm having problems sending binary files.
> >
> > I'm debugging the python script and I see that the file is being read to
> a
> > string variable.
> > My question is:
> > What encoding is being used when converting from a binary byte-array to a
> > string?
> >
> > I have tried UTF8 and ASCII encoding to get the file's content as a
> string,
> > the file is being uploaded, but when I download it - it's corrupted.
> >
> > Where can I see the specifications of the uploading API?
> >
> > Regards,
> > Adrian Aisemberg
> >
> >
> >
> > --
> > Adrian Aisemberg
> > www.sharpregion.com
> > www.svnmonitor.com
> >
> >
> > >
> >
>
> >
>


-- 
Adrian Aisemberg
www.sharpregion.com
www.svnmonitor.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Hosting at Google Code" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-code-hosting?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to