{ "id": "121666", "key": "TIMOB-15590", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2017-08-08T22:20:42.000+0000", "created": "2013-10-26T20:35:52.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "SupportTeam", "reprod" ], "versions": [ { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-08-15T20:17:16.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h5. Problem description\r\nTitanium.Utils.base64encode generates a truncated blob when operating on Chinese characters.\r\n\r\nh5. Code sample:\r\n\r\n{code:javascript}\r\nvar original = '一些随机的中国文字';\r\nvar reference = '5LiA5Lqb6ZqP5py655qE5Lit5Zu95paH5a2X';\r\nvar encoded = Titanium.Utils.base64encode(original).text;\r\nconsole.log('encoded: ' + encoded);\r\nconsole.log('reference: ' + reference);\r\nconsole.log('encoded ' + (encoded === reference ? '===' : '!==') + ' reference');\r\n{code}\r\n\r\n\r\n\r\nh5. Steps to reproduce\r\n1. Create a new mobile project\r\n2. Paste this to app.js: \r\n3. Run and check the console.\r\nh5. Output:\r\n{noformat}\r\nencoded: 5LiA5Lqb6ZqP\r\nreference: 5LiA5Lqb6ZqP5py655qE5Lit5Zu95paH5a2X\r\nencoded !== reference\r\n{noformat}\r\n\r\nh5. Expected output:\r\n{noformat}\r\nencoded: 5LiA5Lqb6ZqP5py655qE5Lit5Zu95paH5a2X\r\nreference: 5LiA5Lqb6ZqP5py655qE5Lit5Zu95paH5a2X\r\nencoded === reference\r\n{noformat}\r\n\r\nWhen \"original\" is Base64-encoded, the result should be equal to \"reference\". However, the blob returned by Titanium.Utils.base64encode is significantly shorter than expected. Titanium.Utils.base64encode apparently cannot properly handle special characters.", "attachment": [], "flagged": false, "summary": "Titanium.Utils.base64decode truncates result with foreign characters", "creator": { "name": "calebcox314", "key": "calebcox314", "displayName": "Caleb Cox", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "Titanium SDK 3.1.3\r\niOS SDK 7.0.3\r\nMac OS X 10.9", "closedSprints": [ { "id": 933, "state": "closed", "name": "2017 Sprint 16 SDK", "startDate": "2017-07-30T16:17:10.306Z", "endDate": "2017-08-13T16:17:00.000Z", "completeDate": "2017-08-13T23:06:34.398Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "395022", "author": { "name": "ivo.tasevski", "key": "ivo.tasevski", "displayName": "Ivo", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We also have the same problem when Chinese characters are present in the string data we want to base64 encode.", "updateAuthor": { "name": "ivo.tasevski", "key": "ivo.tasevski", "displayName": "Ivo", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-09-01T08:02:19.000+0000", "updated": "2016-09-01T08:02:19.000+0000" }, { "id": "422528", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am able to reproduce this issue with the following environment;\r\niPhone 7 (10.2)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1.v20170620103414\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.1\r\nTi CLI 5.0.13\r\nAlloy 1.9.11\r\nArrow 2.0.0\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-21T23:46:16.000+0000", "updated": "2017-06-21T23:46:16.000+0000" }, { "id": "426276", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Marking as duplicate of TIMOB-20395.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-08T21:13:31.000+0000", "updated": "2017-08-08T21:13:31.000+0000" }, { "id": "426293", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Fixed as part of TIMOB-20395.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-08T22:20:42.000+0000", "updated": "2017-08-08T22:20:42.000+0000" }, { "id": "426704", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-08-15T20:17:16.000+0000", "updated": "2017-08-15T20:17:16.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }