mattlisiv / newsapi-python

A Python Client for News API
MIT License
394 stars 136 forks source link

Added Python 2 unicode support #40

Closed theteleforce closed 5 years ago

theteleforce commented 5 years ago

As per #23, this adds support for unicode query strings in Python 2.x.

Similar support would be easy for other parameters (source, country, etc.) if necessary. That may necessitate making a helper function for the conversion, though, since it'd be a fair bit of code.

Tested on Python 2.7.16

mattlisiv commented 5 years ago

Hi @CocoPommel ,

Thanks for the PR. I like the implementation but I do think it should be a helper function on multiple parameters make the solution complete.

Do you have time to complete that or would you like me to adapt your solution for all string parameters?

theteleforce commented 5 years ago

Done.

The helper function is just tacked onto newsapi_client.py for now. Not sure if you wanted it in its own utils file or something -- it might be out of place where it is, but it's also never used anywhere else.

mattlisiv commented 5 years ago

@CocoPommel Thanks so much!