From b2c51e53d1eea1f16cca29ff5459b81494e3536d Mon Sep 17 00:00:00 2001 From: junedchhipa Date: Sun, 31 Oct 2021 01:37:30 +0530 Subject: [PATCH] hash presence in csv export - fixes #2665 --- src/modules/Exports.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/Exports.js b/src/modules/Exports.js index a45b8c1d7..72260d426 100644 --- a/src/modules/Exports.js +++ b/src/modules/Exports.js @@ -185,7 +185,8 @@ class Exports { let columns = [] let rows = [] - let result = 'data:text/csv;charset=utf-8,\uFEFF' + let result = '' + let universalBOM = '\uFEFF' const isTimeStamp = (num) => { return w.config.xaxis.type === 'datetime' && String(num).length >= 10 @@ -342,8 +343,10 @@ class Exports { result += rows.join(lineDelimiter) + console.log(result, 'result') this.triggerDownload( - encodeURI(result), + 'data:text/csv; charset=utf-8,' + + encodeURIComponent(universalBOM + result), w.config.chart.toolbar.export.csv.filename, '.csv' )