问题
I’m meeting a problem using the Google Drive API v3.
I have files in my Drive which have uppercase accents (screen 1).
When I use the Google API with the list method with this kind of q parameter :
name = ‘Évenement’
Nothing comes out. The problem seems to be the uppercase accent (it works fine in lowercase) in my word, the search works great with the Google Drive interface :
But it fails when I do it with the API :
How should I encode or modify my query to make it work ?
Please note that I’m trying to make this work in a Python application, and I meet the same problem (Also in AppScript), so this doesn’t seem to be related to the client used.
Many thanks for your help.
回答1:
At Drive API, files and folders with the name included the acute accent, umlauts and so on cannot be directly searched using name=
for Q
.
When it searches files and folders with the acute accent, please modify Q
as follows, and try again.
From :
name='Évenement'
To :
name contains 'Évenement'
Result :
{
"kind": "drive#fileList",
"incompleteSearch": false,
"files": [
{
"kind": "drive#file",
"id": "#####",
"name": "Évenement'",
"mimeType": "application/vnd.google-apps.folder"
}
]
}
来源:https://stackoverflow.com/questions/46171471/drive-api-v3-searching-on-list-service-doesnt-work-with-uppercase-accents