2

I am developing a web app using Save to Google Drive Button.

I noticed that an error occurs and the file cannot be saved when I press the button if Japanese (or maybe non-ascii) string has been set to "data-filename" parameter.

<script src="https://apis.google.com/js/platform.js"></script>
<div id="button"
  class="g-savetodrive"
  data-src="<url-of-file>"
  data-filename="<non-ascii-file-name>"
  data-sitename="<site-name>">
</div>

When this happens you can see an error message in Chrome's console like

931819729-doclist_saver_uploader__ja.js:55
Uncaught TypeError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': Value is not a valid ByteString.

Are there any workarounds?

1 Answers1

0

Google Drive doesn't work well with non-ASCII characters. Stick to regular English alphabet. There are several related issues about these which denotes that Google APIs doesn't work well with non-ASCII.

Check this SO post.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
  • Thank you for answering. It matters because it is quite common for people in non-English area to use Google Drive with non-ascii file names like usual file systems. API should also be able to handle this therefore. – Taro Hashimoto Feb 16 '18 at 06:20
  • if a certain system was designed on the onset with certain restrictions, who should adjust, the user or the system? – ReyAnthonyRenacia Feb 16 '18 at 06:23
  • I do not intend to be aggressive. I simply stated a fact that file systems are used with non-ascii characters worldwide. – Taro Hashimoto Feb 16 '18 at 06:27