Skip to content

Commit

Permalink
fix CI errors related to octave utf-8 handling
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Jun 19, 2023
1 parent 1e93d07 commit b267858
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion loadbj.m
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
fid = fopen(fname,'rb');
string = fread(fid,jsonopt('MaxBuffer',inf,opt),'uint8=>char')';
fclose(fid);
elseif(all(fname<128) && regexpi(fname,'^\s*(http|https|ftp|file)://'))
elseif(all(fname<128) && ~isempty(regexpi(fname,'^\s*(http|https|ftp|file)://')))
string = char(webread(fname, weboptions('ContentType','binary')))';
elseif(~isempty(fname) && any(fname(1)=='[{SCHiUIulmLMhdDTFZN'))
string=fname;
Expand Down
2 changes: 1 addition & 1 deletion savejson.m
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
% save to a file if FileName is set, suggested by Patrick Rapin
filename = jsonopt('FileName', '', opt);
if (~isempty(filename))
if(jsonopt('UTF8', 1, opt) && exist('unicode2native'))
if(jsonopt('UTF8', 1, opt) && exist('unicode2native', 'builtin'))
json= unicode2native(json);
end

Expand Down

0 comments on commit b267858

Please sign in to comment.