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

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

问题描述

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

I’m meeting a problem using the Google Drive API v3.

我的云端硬盘中有带有大写重音符号的文件(屏幕 1).

I have files in my Drive which have uppercase accents (screen 1).

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

When I use the Google API with the list method with this kind of q parameter :

name = 'Évenement'

name = ‘Évenement’

什么都没有出来.问题似乎是我的话中的大写重音(它在小写中可以正常工作),搜索在 Google Drive 界面上效果很好:

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 :

但是当我使用 API 时它失败了:

But it fails when I do it with the API :

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

How should I encode or modify my query to make it work ?

请注意,我正在尝试在 Python 应用程序中进行这项工作,并且遇到了同样的问题(也在 AppScript 中),因此这似乎与所使用的客户端无关.

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.

非常感谢您的帮助.

推荐答案

在Drive API中,名称中包含重音、变音等的文件和文件夹不能使用name=直接搜索对于Q.

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.

搜索带重音的文件和文件夹时,请修改Q如下,然后重试.

When it searches files and folders with the acute accent, please modify Q as follows, and try again.

name='Évenement'

收件人:

name contains 'Évenement'

结果:

{
 "kind": "drive#fileList",
 "incompleteSearch": false,
 "files": [
  {
   "kind": "drive#file",
   "id": "#####",
   "name": "Évenement'",
   "mimeType": "application/vnd.google-apps.folder"
  }
 ]
}

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

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