diff --git a/src/BootstrapTable.js b/src/BootstrapTable.js index 1ed3e6ee8..4f9f7fe18 100644 --- a/src/BootstrapTable.js +++ b/src/BootstrapTable.js @@ -1073,7 +1073,7 @@ class BootstrapTable extends Component { csvFileName = csvFileName(); } - exportCSVUtil(result, keys, csvFileName, separator, noAutoBOM || true, excludeCSVHeader); + exportCSVUtil(result, keys, csvFileName, separator, noAutoBOM, excludeCSVHeader); } handleSearch = searchText => { diff --git a/src/csv_export_util.js b/src/csv_export_util.js index 839f92479..929b47e83 100644 --- a/src/csv_export_util.js +++ b/src/csv_export_util.js @@ -61,6 +61,7 @@ function toString(data, keys, separator, excludeCSVHeader) { const exportCSV = function(data, keys, filename, separator, noAutoBOM, excludeCSVHeader) { const dataString = toString(data, keys, separator, excludeCSVHeader); if (typeof window !== 'undefined') { + noAutoBOM = noAutoBOM === undefined ? true : noAutoBOM; saveAs(new Blob([ dataString ], { type: 'text/plain;charset=utf-8' }), filename, noAutoBOM);