Drive API V3 - 在列表服务上搜索不适用于大写字母 [英] Drive API V3 - Searching on list service doesn't work with Uppercase accents

查看:99
本文介绍了Drive API V3 - 在列表服务上搜索不适用于大写字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用Google Drive API v3时遇到问题。



我的云端硬盘中有大写字母(屏幕1)的文件。



当我使用带有这种q参数的list方法使用Google API时:

name ='Évenement'



没有东西出来。这个问题似乎是大写口音(小写字母很好用),这个搜索在Google Drive界面中很有用:



但是,当我使用API​​进行操作时,它会失败:



我应该如何编码或修改我的查询以使其工作?

请注意,我试图在Python应用程序中完成这项工作,并遇到同样的问题(同样在AppScript中),所以这似乎并不与您使用的客户端有关。



非常感谢您的帮助。 在Drive API中,对于 Q,无法使用 name = 直接搜索名称中包含尖锐重音,元音变音等的文件和文件夹



当使用尖锐口音搜索文件和文件夹时,请修改 Q 如下所示,然后再试一次。



From:



  name = 'Évenement'



收件人:



  name包含'Évenement'



结果:





$ kind $ b $ drive_fileList $ b $ incompleteSearch $ false b $ b文件:[
{
kind:drive#file,
id:#####,
name: Évenement',
mimeType:application / vnd.google-apps.folder
}
]
}


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.

解决方案

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

这篇关于Drive API V3 - 在列表服务上搜索不适用于大写字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆