1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-12 16:48:10 +00:00

data/ExperimentHandler: tweak for XLSX not prepending BOM when converting to csv

This commit is contained in:
Sotiri Bakagiannis 2021-05-07 14:33:03 +01:00
parent 980519c84c
commit 98a5de434f

View File

@ -302,7 +302,8 @@ export class ExperimentHandler extends PsychObject
// note: we use the XLSX library as it automatically deals with header, takes care of quotes, // note: we use the XLSX library as it automatically deals with header, takes care of quotes,
// newlines, etc. // newlines, etc.
const worksheet = XLSX.utils.json_to_sheet(this._trialsData); const worksheet = XLSX.utils.json_to_sheet(this._trialsData);
const csv = XLSX.utils.sheet_to_csv(worksheet); // prepend BOM
const csv = '\ufeff' + XLSX.utils.sheet_to_csv(worksheet);
// upload data to the pavlovia server or offer them for download: // upload data to the pavlovia server or offer them for download:
const key = __participant + '_' + __experimentName + '_' + __datetime + '.csv'; const key = __participant + '_' + __experimentName + '_' + __datetime + '.csv';