You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the presence of tabs in a JSON file can cause loadjson() to load certain files differently. Using revision f8def3d of jsonlab with either MATLAB R2016a or Octave 4.2.0, loading foo.json from files.zip (which contains tabs) using data = loadjson('foo.json') causes data.a.b.c to be created as a cell array, while loading bar.json (which contains only spaces) causes data.a.b.c to be created as a matrix. Shouldn't c always be created as a matrix regardless of the whitespace?
The text was updated successfully, but these errors were encountered:
@lebedov, thanks for reporting this issue. I debugged loadjson with both of your provided json files, and found the issue was caused by sscanf when parsing trailing whitespace in an array construct. for example:
return different errmsg and nextidx outputs. I added one line to remove the trailing white space, and now both inputs generate the same array. let me know if there is any problem with this fix.
It seems that the presence of tabs in a JSON file can cause
loadjson()
to load certain files differently. Using revision f8def3d of jsonlab with either MATLAB R2016a or Octave 4.2.0, loadingfoo.json
from files.zip (which contains tabs) usingdata = loadjson('foo.json')
causesdata.a.b.c
to be created as a cell array, while loadingbar.json
(which contains only spaces) causesdata.a.b.c
to be created as a matrix. Shouldn'tc
always be created as a matrix regardless of the whitespace?The text was updated successfully, but these errors were encountered: