From 1ed32f0ce4a983574b04cb0476343ec31409985e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 8 Aug 2022 13:51:02 +0100 Subject: [PATCH] charset encoding --- packages/server/src/utilities/fileSystem/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index f4aebd11a8..e421d19275 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -106,8 +106,10 @@ exports.loadHandlebarsFile = path => { */ exports.apiFileReturn = contents => { const path = join(budibaseTempDir(), uuid()) - fs.writeFileSync(path, contents) - return fs.createReadStream(path) + fs.writeFileSync(path, "\ufeff" + contents) + let readerStream = fs.createReadStream(path) + readerStream.setEncoding("binary") + return readerStream } exports.defineFilter = excludeRows => {