win32clipboard.GetClipboardData() return string with null characters

aurora aurora00 at gmail.com
Thu May 26 00:30:16 EDT 2005


I was using win32clipboard.GetClipboardData() to retrieve the Windows  
clipboard using code similar to the message below:

http://groups-beta.google.com/group/comp.lang.python/msg/3722ba3afb209314?hl=en

Some how I notice the data returned includes \0 and some characters that  
shouldn't be there after the null character. It is easy enough to truncate  
them. But why does it get there in the first place? Is the data length  
somehow calculated wrong?

I'm using Windows XP SP2 with Python 2.4 and pywin32-203.

aurora



More information about the Python-list mailing list