{ "id": "81986", "key": "TIMOB-5878", "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": "13273", "description": "Release 2.0.2", "name": "Release 2.0.2", "archived": false, "released": true, "releaseDate": "2012-05-31" }, { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" }, { "id": "13277", "name": "Sprint 2012-08", "archived": true, "released": true, "releaseDate": "2012-04-22" }, { "id": "13270", "description": "Release 1.8 Service Pack 3 (CI for 1_8_X)", "name": "Release 1.8.3", "archived": true, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-04-18T10:38:45.000+0000", "created": "2011-10-26T12:36:59.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api", "module_textarea", "parity", "qe-manualtest" ], "versions": [ { "id": "11971", "description": "iOS5 and select Android fixes", "name": "Release 1.7.3", "archived": true, "released": true, "releaseDate": "2011-10-18" } ], "issuelinks": [ { "id": "16539", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "81852", "key": "TIMOB-6922", "fields": { "summary": "Android: Network - HTTPClient cannot retrieve non-ascii data", "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 } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-08-07T22:28:41.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": "TextArea does not decode UTF8 character correctly.\r\n\r\nh4. Repro Steps\r\nStep 1: Open Kitchen Sink on Android \r\nStep 2: Go to Platform - XHR - UTF-8 + GET/POST\r\n\r\nExpected result: The string \"€漢字\" should be shown in the textarea.\r\nActual result: Some garbage characters was shown.\r\n\r\nh4. Workaround\r\nIn Javascript code, call the following decode function to decode what returns from HttpClient's responseText.\r\n{code}\r\nvar myDecode = function (utftext) {\r\n\t\tvar string = \"\";\r\n\t\tvar i = 0;\r\n\t\tvar c = c1 = c2 = 0;\r\n \r\n\t\twhile ( i < utftext.length ) {\r\n \r\n\t\t\tc = utftext.charCodeAt(i);\r\n \r\n\t\t\tif (c < 128) {\r\n\t\t\t\tstring += String.fromCharCode(c);\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\telse if((c > 191) && (c < 224)) {\r\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\r\n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\r\n\t\t\t\ti += 2;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\r\n\t\t\t\tc3 = utftext.charCodeAt(i+2);\r\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\r\n\t\t\t\ti += 3;\r\n\t\t\t}\r\n \r\n\t\t}\r\n \r\n\t\treturn string;\r\n}\r\n{code}\r\n\r\nh4. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-589719\r\n \r\n", "attachment": [], "flagged": false, "summary": "Android: Titanium.UI.TextArea does not decode UTF8 character correctly. ", "creator": { "name": "qgao", "key": "qgao", "displayName": "Qing Gao", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "qgao", "key": "qgao", "displayName": "Qing Gao", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 1.7.3\r\niOS Simulator 5.0", "comment": { "comments": [ { "id": "170958", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The sample fails because in Android, the function getResponseText() in TiHTTPClient.java uses charset=HTTP.DEFAULT_CONTENT_CHARSET which is \"ISO-8859-1\" as the default to encode responseData to a string when the http response doesn't specify a charset. The corresponding iOS code uses \"UTF-8\" as the default and the sample runs fine in iOS. The HTTP spec says using a default charset value of \"ISO-8859-1\" in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7.1 . Need a parity discussion with iOS.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-31T14:57:08.000+0000", "updated": "2011-10-31T14:57:08.000+0000" }, { "id": "188554", "author": { "name": "falk", "key": "falk", "displayName": "MAIRDUMONT GmbH & Co. KG", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Uhm... any chances to get this resolved in, let's say, Mobile SDK 2.0?\r\nWould like to get rid of the decode function for Android.", "updateAuthor": { "name": "falk", "key": "falk", "displayName": "MAIRDUMONT GmbH & Co. KG", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-26T03:40:20.000+0000", "updated": "2012-03-26T03:40:20.000+0000" }, { "id": "194033", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 2.0.2.v20120505151714 with Samsung Nexus S 4.0.4", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-05-07T16:13:58.000+0000", "updated": "2012-05-07T16:13:58.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }