Mendeley / mendeley-python-sdk

Python SDK for the Mendeley API.
Apache License 2.0
119 stars 59 forks source link

Encoding issue on catalog search #27

Open mebibou opened 3 years ago

mebibou commented 3 years ago

When searching for a title that contains some parenthesis, I do not get any response, example:

session.catalog.search('A lysimeter study of nitrate leaching, optimum fertilisation rate and growth responses of corn (Zea mays L.) following soil amendment with water-saving super-absorbent polymer')

gives no result even though the entry definitely exist with the exact same title: https://www.mendeley.com/search/?query=A+lysimeter+study+of+nitrate+leaching%2C+optimum+fertilisation+rate+and+growth+responses+of+corn+%28Zea+mays+L.%29+following+soil+amendment+with+water-saving+super-absorbent+polymer&dgcid=md_homepage

However, from the url of the link I can see some chars were converted to their ascii equivalent, so this search will work:

session.catalog.search('A lysimeter study of nitrate leaching%2C optimum fertilisation rate and growth responses of corn %28Zea mays L.%29 following soil amendment with water-saving super-absorbent polymer')

I see the code is using urlencode for this but I guess it doesn't work that well?