Skip to content

Gibberish returned from gapi.client.drive.files.get() using alt: 'media' if content includes non-English (charset?) letters #1188

@thexs-dev

Description

@thexs-dev

I am using the following code to get the content of a text file uploaded (plain text with MimeType.JAVASCRIPT) to Google Drive.

let response = await gapi.client.drive.files.get({
  'fileId': "google-drive-file-id-goes-here", alt: 'media'
});
let content = response.body;

It gets the actual content in Google Drive if the content only includes English (charset?) letters

  • But if the file has other letters, the content shows them as gibberish instead

See example below for the word Pharmacy in other languages and what the content is showing between ()

  • Hebrew: בית מרקחת (× × ×ª × ×¨×§× ×ª)
  • Japanese 薬局 (è ¬å±)
  • Arabic: مقابل (٠٠ابÙ)

How to fix this issue using the gapi.client.drive.files.get() function?

Thanks in advance for your support on this
Fausto

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions