diff --git a/bids_export.m b/bids_export.m index 23f15a9..e1559b5 100644 --- a/bids_export.m +++ b/bids_export.m @@ -1203,7 +1203,7 @@ function printEventHeader(eInfo) function writejson(fileName, matlabStruct) jsonStr = jsonencode(matlabStruct); -fid = fopen(fileName, 'w'); +fid = fopen(fileName, 'w', 'n', 'UTF-8'); if fid == -1, error('Cannot write file - make sure you have writing permission'); end fprintf(fid, '%s', jsonStr); fclose(fid); @@ -1211,7 +1211,7 @@ function writejson(fileName, matlabStruct) % write TSV file % -------------- function writetsv(fileName, matlabArray) -fid = fopen(fileName, 'w'); +fid = fopen(fileName, 'w', 'n', 'UTF-8'); if fid == -1, error('Cannot write file - make sure you have writing permission'); end for iRow=1:size(matlabArray,1) for iCol=1:size(matlabArray,2)