{ "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
\n

Where 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
\n

Makes sense as it's trying to parse that string as JSON, which\nit isn't.

{html}", "attachment": [], "flagged": false, "summary": "Android: File.toString() fails", "creator": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "128336", "author": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Oops. Missed this post at:

\n

\nhttp://developer.appcelerator.com/question/33111/object-tiblob-resp...

\n

Wierd it's working on the iPhone though. This ticket can be\nclosed.

{html}", "updateAuthor": { "name": "robby", "key": "robby", "displayName": "Robby", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:18:25.000+0000", "updated": "2011-04-15T03:18:25.000+0000" }, { "id": "128337", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Right.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:18:26.000+0000", "updated": "2011-04-15T03:18:26.000+0000" }, { "id": "410965", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T23:16:53.000+0000", "updated": "2017-03-09T23:16:53.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }