Skip to content

Commit 3fda8d8

Browse files
committed
remove bom from tsv output
1 parent 705c84c commit 3fda8d8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/utils/files.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ function writeWorkbook(workbook, baseName, ext, opt = {}) {
154154
* and https://github.com/SheetJS/sheetjs
155155
* Solution at bottom of: https://github.com/SheetJS/sheetjs/issues/943
156156
* The "Comma Separated Values" format is actually UTF-8 with BOM prefix.
157+
* A “U+” designation refers to a character, and in this case that would be
158+
* U+FEFF; the start of the file is the three-byte sequence EF BB BF which is
159+
* how U+FEFF is represented in UTF-8.
157160
* @param {Workbook} workbook workboox to download.
158161
* @param {String} baseName Basename of downloaded file.
159162
* @param {String} ext Extension of downloaded file.
@@ -224,8 +227,8 @@ export function exportWorkbook(workbook, baseName, ext) {
224227
* available, and resulting file is UTF-8 +BOM anyways.
225228
*/
226229
case 'tsv': // UTF-8 BOM version
227-
// SheetJS note: For compatibility with Excel, csv output will always
228-
// include the UTF-8 byte order mark ("BOM").
230+
// SheetJS note: For compatibility with Excel, writeFile() csv output
231+
// will always include the UTF-8 byte order mark ("BOM").
229232
//writeFile(workbook, fileName, {bookType: 'csv', FS: '\t'});
230233
data = XlsxUtils.sheet_to_csv(worksheet, {FS: '\t'});
231234
//data = '\uFEFF' + data; //BOM

0 commit comments

Comments
 (0)