{ "id": "63020", "key": "TIMOB-2388", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-04-15T03:18:26.000+0000", "created": "2011-04-15T03:18:25.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "json", "regression", "tostring" ], "versions": [], "issuelinks": [], "assignee": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:16:53.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
Fails when trying to read in JSON data from a file. E.g.
\n\nvar slFile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, slFilePath);\nvar slFileData = slFile.read();\nTi.API.info(\"JSON Data is: '\" + slFileData.toString() + \"'\");\nslCachedData = JSON.parse(slFileData.toString());
\n
\nWhere slFilePath is a valid path to a .json file with valid JSON\ndata in it (this code works fine under iPhone with the same data).\nThe above prints out \"[INFO] [27,24101] JSON Data is: '[object\nTiBlob]'\". Because the conversion to string does not work, I then\nget a JSON parse error:
\n\n[TRACE] E/KrollMethod( 450): (kroll$3) [4,24105] Exception calling kroll method parse, invocation: [callMethod JSON.parse ti.modules.titanium.json.JSONModuleBindingGen$2@451a19f0\"json\"=[object TiBlob]]\n[TRACE] E/KrollMethod( 450): org.json.JSONException: Unterminated array at character 9 of [object TiBlob]
\n
\nMakes sense as it's trying to parse that string as JSON, which\nit isn't.
Oops. Missed this post at:
\n\nhttp://developer.appcelerator.com/question/33111/object-tiblob-resp...
\nWierd it's working on the iPhone though. This ticket can be\nclosed.
Right.