andyguzman/PopClippins

non-Western characters

Closed this issue · 3 comments

Hi,

For some reasons your PopClip extension Lucky Link doesn't seem to work with non-Western characters (be it, for instance, European umlauts / accents characters or Cyrillic ones).

Thanks.

Hmmm... I see there are some restrictions with Unicode and urllib in Python I hadn't planned for. I bet that is where it is choking, because it essentially takes the text you highlight and appends it to a Google search URL.

http://stackoverflow.com/questions/5557849/is-there-a-unicode-ready-substitute-i-can-use-for-urllib-quote-and-urllib-unquot

I'll try and take a look at it as soon as I can, but if you are familiar at all with Python you're more than welcome to take a stab at it.

Thanks for pointing that out!

Unfortunately, I'm not a programmer :).

Interestingly, this has to do with different encoding on the inputphrase vs json string. Not entirely sure why that is, but wrapping both in str() forces identical encoding and fixes the issue.