Re: Checking for binary data in a string

2009-06-20 Thread Grant Edwards
On 2009-06-19, Lie Ryan lie.1...@gmail.com wrote: Grant Edwards wrote: On 2009-06-19, Mitko Haralanov mi...@qlogic.com 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.

Re: Checking for binary data in a string

2009-06-19 Thread Grant Edwards
On 2009-06-19, Mitko Haralanov mi...@qlogic.com 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

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

Re: Checking for binary data in a string

2009-06-19 Thread Lie Ryan
Grant Edwards wrote: On 2009-06-19, Mitko Haralanov mi...@qlogic.com 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

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? snip 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