drag drop from linux to a wxpython application

Daniel Dittmar daniel.dittmar at sap.com
Wed May 19 07:21:06 EDT 2004


marco wrote:
> I've got a wxpython application
> and when i drag'n' drop files from(linux) rox/nautilus/konqueror to
> my app i've got strange chars in filenames (on win32 : it works well)
>
> example:
> - my dir "my photos" will become "/home/marc/my%20photos"
> - a dir "fêtes à strass" will become (something like this)
> "/home/marc/f%A8%CFtes%20%8F%AC%20strass"

use urllib.unquote:
>>> import urllib
>>> urllib.unquote ("/home/marc/my%20photos")
'/home/marc/my photos'

I guess that the result is a utf8 string which has to be translated to ASCII
Latin1 or UCS[24] to become a regular Python string. At least that would
explain why ê and à occupy two characters in the encoded form.

Daniel





More information about the Python-list mailing list