Fixed handling of unicode params

Because `urllib.quote` does not handle non-ASCII characters, we have to first encode the string to utf-8 before passing it. 

This PR fixes handling of unicode characters in the params. The test should be self-explanatory about the use case that is fixed.