Skip to content

Commit

Permalink
fix utf8 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
arnodelorme committed Oct 19, 2021
1 parent 670e01b commit 2adeb1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bids_export.m
Original file line number Diff line number Diff line change
Expand Up @@ -1203,15 +1203,15 @@ 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);

% 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)
Expand Down

0 comments on commit 2adeb1d

Please sign in to comment.