From 2da47e476d180452c3fd50beff43636e2a253157 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:55:45 +0000 Subject: [PATCH] fix(nc-gui): add encoding option in csv export --- .../nc-gui/extensions/data-exporter/index.vue | 93 +++++++++++++------ packages/nocodb/src/interface/Jobs.ts | 1 + .../jobs/data-export/data-export.processor.ts | 3 +- .../jobs/jobs/export-import/export.service.ts | 5 +- 4 files changed, 72 insertions(+), 30 deletions(-) diff --git a/packages/nc-gui/extensions/data-exporter/index.vue b/packages/nc-gui/extensions/data-exporter/index.vue index c383b4a8dd..43607d6949 100644 --- a/packages/nc-gui/extensions/data-exporter/index.vue +++ b/packages/nc-gui/extensions/data-exporter/index.vue @@ -94,8 +94,10 @@ const exportPayload = ref<{ tableId?: string viewId?: string delimiter?: string + encoding?: BufferEncoding }>({ delimiter: ',', + encoding: 'utf8', }) const tableList = computed(() => { @@ -166,6 +168,7 @@ async function exportDataAsync() { const jobData = await $api.export.data(exportPayload.value.viewId, 'csv', { extension_id: extension.value.id, delimiter: exportPayload.value.delimiter, + encoding: exportPayload.value.encoding, }) jobList.value.unshift(jobData) @@ -279,6 +282,7 @@ eventBus.on(async (event, payload) => { onMounted(async () => { exportPayload.value = extension.value.kvStore.get('exportPayload') || {} exportPayload.value.delimiter = exportPayload.value.delimiter || ',' + exportPayload.value.encoding = exportPayload.value.encoding || 'utf8' deletedExports.value = extension.value.kvStore.get('deletedExports') || [] @@ -411,33 +415,68 @@ onMounted(async () => { -