Re: Checking for binary data in a string

2009-06-20 Thread Grant Edwards
On 2009-06-19, Lie Ryan wrote: > Grant Edwards wrote: >> On 2009-06-19, Mitko Haralanov wrote: >> >>> I have a question about finding out whether a string contains >>> binary data? >> >> All strings contain binary data. > > Not quite, (python 2.x's) strings are binary data. > > It just happen

Re: Checking for binary data in a string

2009-06-19 Thread Emile van Sebille
On 6/19/2009 1:18 PM Mitko Haralanov said... I have a question about finding out whether a string contains binary data? The only other check that I can think of is to check every character in the read-in string against string.printable but that will take a long time. Well, probably not rea

Re: Checking for binary data in a string

2009-06-19 Thread Lie Ryan
Grant Edwards wrote: > On 2009-06-19, Mitko Haralanov wrote: > >> I have a question about finding out whether a string contains >> binary data? > > All strings contain binary data. Not quite, (python 2.x's) strings are binary data. It just happens that it behaves like text when you appropria

Re: Checking for binary data in a string

2009-06-19 Thread Dave Angel
Mitko Haralanov wrote: I have a question about finding out whether a string contains binary data? In my application, I am reading from a file which could contain binary data. After I have read the data, I transfer it using xmlrpclib. However, xmlrpclib has trouble unpacking XML which contains b

Re: Checking for binary data in a string

2009-06-19 Thread Grant Edwards
On 2009-06-19, Mitko Haralanov wrote: > I have a question about finding out whether a string contains > binary data? All strings contain binary data. Unless you've invented ternary logic and built a computer with it. ;) > If I read in a string containing some binary data from the file, the > t

Checking for binary data in a string

2009-06-19 Thread Mitko Haralanov
I have a question about finding out whether a string contains binary data? In my application, I am reading from a file which could contain binary data. After I have read the data, I transfer it using xmlrpclib. However, xmlrpclib has trouble unpacking XML which contains binary data and my applica