Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
991 views
in Technique[技术] by (71.8m points)

google api - Drive API V3 - Searching on list service doesn't work with Uppercase accents

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 :

enter image description here

But it fails when I do it with the API :

enter image description here

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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"
  }
 ]
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...