ericyd / gdrive-copy

Web app to copy a Google Drive folder
https://script.google.com/macros/s/AKfycbxbGNGajrxv-HbX2sVY2OTu7yj9VvxlOMOeQblZFuq7rYm7uyo/exec
MIT License
1.58k stars 343 forks source link

fix garbled file's title on leftfovers. #63

Closed fossamagna closed 5 years ago

fossamagna commented 5 years ago

When file's title on leftovers contains multi-bytes character, copied file's title was garbled. Drive.Files.get(id, {alt: 'media'}) cannot specify content encoding. The content encoding is expected UTF-8. So, getBlob().getDataAsString() Instead of Files.get().

ericyd commented 5 years ago

First, let me say thank you for contributing!

Second, what functional change does this achieve? Are you getting garbled file names during the copy process or is it just the "leftovers" file you're trying to fix. I'm less inclined to introduce changes if its just the leftovers file - the titles in that file are not used after the top-level folder is created.

ericyd commented 5 years ago

Nevermind my second comment, I realized where this is used. Let me try to find some time this weekend to do some testing and make sure this doesn't break anything so I can get this merged.

ericyd commented 5 years ago

Merged and deployed!

Thanks for contributing. Sorry it took me so long to review, the holidays got really busy at work and personally. I appreciate the fix, though - I believe this was the underlying bug behind #49 but I wasn't able to reproduce previously. Now it is fixed for good!