{ "id": "170317", "key": "TIMOB-25513", "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": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-10-16T12:38:34.000+0000", "created": "2017-11-15T04:01:20.000+0000", "epic": { "id": 170942, "key": "TIMOB-25710", "name": "SDK Parity effort", "summary": "SDK Parity effort", "color": { "key": "color_1" }, "done": false }, "priority": { "name": "High", "id": "2" }, "labels": [ "parity" ], "versions": [ { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "56146", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "outwardIssue": { "id": "91758", "key": "TIMOB-9111", "fields": { "summary": "TiAPI: Ti.Utils.base64encode behaves different between Android and iOS/Android", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56435", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "171461", "key": "TIMOB-25935", "fields": { "summary": "Windows: Ti.Utils.base64decode should ignore line breaks", "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" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56433", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "169499", "key": "TIMOB-25145", "fields": { "summary": "Windows: Mocha test Titanium.Utils #base64decode(Ti.Blob) test failure", "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" } }, "priority": { "name": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2018-10-16T15:29:30.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": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "h3. Problem\r\n\r\nThe result of Ti.Utils.base64encode is different between iOS and Android. On iOS there are newline characters included when the string is long enough, on Android the newline characters are stripped out (which is the correct way to do base64 UTF8 encoding). Please see the attached screenshot explaining the issue. \r\n\r\nh3. Sample Code\r\n\r\n{noformat}\r\n\r\n(function() {\r\n \r\n var win = Ti.UI.createWindow({backgroundColor:'white'});\r\n win.open();\r\n var shortString = 'ABCDEFGHIJ1234567890ABCDEFGHIJ12|psndemo2|abcd:1';\r\n var longString = 'ABCDEFGHIJ1234567890ABCDEFGHIJ12|psndemo2|abcd:12345678901234567890';\r\n var tiBase64ShortResult = Ti.Utils.base64encode(shortString);\r\n var tiBase64LongResult = Ti.Utils.base64encode(longString);\r\n\r\n tiBase64ShortResult = String(tiBase64ShortResult);\r\n tiBase64LongResult = String(tiBase64LongResult);\r\n\r\n\r\n // BUG #2: Run this code in iOS and Android and compare the results\r\n // On iOS we get newline characters. On Android the newline characters are stripped out.\r\n // The correct behavior for UTF8 base64 encoding is to strip out the newline characters. \r\n // Android's implementation is correct.\r\n tiBase64ShortResult = tiBase64ShortResult.replace(/\\r\\n/g,\"***NEWLINE***\");\r\n tiBase64LongResult = tiBase64LongResult.replace(/\\r\\n/g,\"***NEWLINE***\");\r\n var alertDialog = Titanium.UI.createAlertDialog(\r\n {\r\n title: 'Result', \r\n message: 'short: ' + tiBase64ShortResult + '\\nlong: ' + tiBase64LongResult, buttonNames: ['OK','Cancel'] \r\n });\r\n alertDialog.show();\r\n})();\r\n\r\n{noformat}", "attachment": [ { "id": "63598", "filename": "encodedFile.txt", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-11-15T04:01:21.000+0000", "size": 29, "mimeType": "text/plain" }, { "id": "63597", "filename": "Screen shot 2012-05-08 at 3.43.47 PM.png", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-11-15T04:01:21.000+0000", "size": 690743, "mimeType": "image/png" } ], "flagged": false, "summary": "Windows: Ti.Utils.base64encode behaves different between Android/iOS and Windows", "creator": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium SDK: 2.0.1GA2\r\nPlatform OS: iOS ", "closedSprints": [ { "id": 1073, "state": "closed", "name": "2018 Sprint 19 SDK", "startDate": "2018-09-09T21:02:56.422Z", "endDate": "2018-09-23T21:02:00.000Z", "completeDate": "2018-09-23T22:28:10.932Z", "originBoardId": 114 }, { "id": 1078, "state": "closed", "name": "2018 Sprint 20 SDK", "startDate": "2018-09-23T16:57:58.349Z", "endDate": "2018-10-07T16:57:00.000Z", "completeDate": "2018-10-07T23:31:40.476Z", "originBoardId": 114 }, { "id": 1065, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2018-08-13T17:39:36.846Z", "endDate": "2018-08-27T17:39:00.000Z", "completeDate": "2018-08-29T16:10:57.013Z", "originBoardId": 114 }, { "id": 1084, "state": "closed", "name": "2018 Sprint 21", "startDate": "2018-10-07T23:32:40.560Z", "endDate": "2018-10-21T23:32:00.000Z", "completeDate": "2018-10-21T23:19:05.460Z", "originBoardId": 114 }, { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 }, { "id": 1053, "state": "closed", "name": "2018 Sprint 15 SDK", "startDate": "2018-07-15T21:52:05.453Z", "endDate": "2018-07-29T21:52:00.000Z", "completeDate": "2018-07-29T22:25:11.723Z", "originBoardId": 114 }, { "id": 1070, "state": "closed", "name": "2018 Sprint 18 SDK", "startDate": "2018-08-26T16:14:35.297Z", "endDate": "2018-09-09T16:14:00.000Z", "completeDate": "2018-09-11T20:59:21.495Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "436818", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile_windows/pull/1220", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-04-12T02:37:55.000+0000", "updated": "2018-04-12T02:37:55.000+0000" }, { "id": "442259", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR Passed. Waiting for CR and merge", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-10-03T21:33:20.000+0000", "updated": "2018-10-03T21:33:20.000+0000" }, { "id": "442656", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "*Closing ticket*. Verified fix in SDK Version {{7.5.0.v20181016071050.}}\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile_windows/pull/1220", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-16T15:29:22.000+0000", "updated": "2018-10-16T15:29:22.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }