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

Categories

0 votes
1.1k 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...