nate-parrott / Flashlight

The missing Spotlight plugin system
http://flashlight.nateparrott.com
Other
5.39k stars 411 forks source link

Encoding issue #172

Closed xremix closed 9 years ago

xremix commented 9 years ago

Flashlight plugins are crashing if there are special characters inside (like German umlauts ä,ü,ö, etc) and the query is trying to url encode the string, like in this example:

https://github.com/nate-parrott/Flashlight/blob/master/PluginDirectories/1/wikipedia.bundle/plugin.py#L14

@nate-parrott Is using an UTF-8 encoding the only solution or could you do something with passing the query info? Right now I have to do something similar like:

parsed[key] = parsed[key].encode("utf-8")
``
nate-parrott commented 9 years ago

This is a Python issue, more than anything — I've started passing unicode strings in query info (because that seems like the right thing to do with regards to i18n), but certain functions like urllib.quote_plus just don't like unicode, and require the .encode('utf-8') to not crash.