const requestBody = {
name,
parents: [folderId],
mimeType: 'application/vnd.google-apps.document',
};
const media = {
mimeType: 'text/plain',
body: 'foo', // <--- This string doesn't have a BOM.
};
const data = await drive.files.create({
requestBody,
media,
fields: 'id',
});
const { data } = await drive.files.export({
fileId: id,
mimeType: 'text/plain',
});
Being the BOM an invisible character, it is increadibly hard to spot. This makes tests and application code harder to develop.
Client library issue
no
no
Environment details
googleapisversion: 61.0.0Steps to reproduce
bodya string that does not begin with a Byte Order Mark and amimeTypeof'text/plain', such asmimeTypeset to'text/plain', such asdata.contentwill contain a string that starts with a Byte Order Mark,"\uFFEFfoo", which was not in the original string.Being the BOM an invisible character, it is increadibly hard to spot. This makes tests and application code harder to develop.