{ "id": "62304", "key": "TIMOB-1672", "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": "11225", "name": "Release 1.5.0", "archived": true, "released": true, "releaseDate": "2010-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:56:49.000+0000", "created": "2011-04-15T02:59:01.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-04-17T01:56:49.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}

Customer uses a feed service which provides xml in ISO-8859-1.\nThe xml processing instruction accurately reflects that the\ncharset=ISO-8859-1. Our HTTPClient.responseText also\naccurately determines the charset, but\nHTTPClient.responseXML just hands off the string to\nXMLModule.parse without telling it what the encoding\nis.

\n

In the customer's specific case, this meant that umlauts (e.g.,\nö) and accented characters (e.g., é) were screwed up\nwhen displayed on the android (or emulator) screen.

\n

Screenshot of problem:

\n

http://skitch.com/billdawson/dwk1r/5560-titanium-5-hvga

{html}", "attachment": [ { "id": "18035", "filename": "emulator.png", "author": { "name": "marco.schierhorn(atgmail)", "key": "marco.schierhorn(atgmail)", "displayName": "marco.schierhorn (at gmail)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:59:01.000+0000", "size": 119408, "mimeType": "image/png" }, { "id": "18037", "filename": "remotefile.js", "author": { "name": "marco.schierhorn(atgmail)", "key": "marco.schierhorn(atgmail)", "displayName": "marco.schierhorn (at gmail)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:59:02.000+0000", "size": 6789, "mimeType": "application/x-javascript" }, { "id": "18036", "filename": "titanium.png", "author": { "name": "marco.schierhorn(atgmail)", "key": "marco.schierhorn(atgmail)", "displayName": "marco.schierhorn (at gmail)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:59:01.000+0000", "size": 148157, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: XHR to XML (responseXML) does not respect encoding", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "126328", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Test case (see me via e-mail for the URL for\nxhr.open() -- it's not to be made public).

\n
\n\nvar win = Titanium.UI.createWindow({  \n    title:'Drivers',\n    backgroundColor:'#fff',\n    fullscreen: true,\n    exitOnClose: true\n});\n\nwin.open();\n\nvar rows = [];\nvar xhr = Ti.Network.createHTTPClient();\nxhr.onload = function(e) {\n    try {\n        var xml = xhr.responseXML;\n        if (xml) {\n            var session = xml.getElementsByTagName('session');\n            if (session) {\n                session = session.item(0);\n            } else { \n                alert('session list not fetched');\n                return;\n            }\n            if (session) {\n                if (!session.hasChildNodes()) {\n                    alert('No child nodes');\n                    return;\n                }\n                var length = session.childNodes.length;\n                for (var i = 0; i < length; i++) {\n                    var child = session.childNodes.item(i);\n                    if (child.nodeType == child.ELEMENT_NODE) {\n                        rows.push(Ti.UI.createTableViewRow({color: 'black', title: child.getAttribute(\"driver\")}));\n                    }\n                }\n                win.add(Ti.UI.createTableView({data: rows}));\n            } else {\n                alert('\"session\" not found');\n            }\n        } else {\n            alert('XML did not load');\n        }\n    } catch(ex) {\n        alert(ex);\n    }\n};\nxhr.open('GET', '(SEE BILL FOR URL -- IT IS NOT TO BE MADE PUBLIC)');\nxhr.send();\n
\n

Screenshot when fixed:
\nhttp://skitch.com/billdawson/dwk16/5560-titanium-5-hvga

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T02:59:02.000+0000", "updated": "2011-04-15T02:59:02.000+0000" }, { "id": "126329", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [5a5703997aa24b161599439e25ca4c5fce0f3e80])\n[#1672 state:fixed-in-qa] XHR now respects\nencoding when passing string to XMLModule.parse for responseXML\n\nhttp://github.com/appcelerator/titanium_mobile/commit/5a5703997aa24...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:59:02.000+0000", "updated": "2011-04-15T02:59:02.000+0000" }, { "id": "126330", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Actually you can get the feed address from the problem\ndescription in helpdesk ticket 38891.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T02:59:02.000+0000", "updated": "2011-04-15T02:59:02.000+0000" }, { "id": "126331", "author": { "name": "marco.schierhorn(atgmail)", "key": "marco.schierhorn(atgmail)", "displayName": "marco.schierhorn (at gmail)", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hey Bill,

\n

thanks a lot for your help again. I have attached 2 screenshots\nbcs im still having the \"umlaut\" issue. And im using the build from\nyour continous build server.

\n

Maybe its because im downloading the file and save it into\nanother file. I have also attached the js file which handles the\ndownloading and saving of the file. And im using responseData\ninstead of responseXML.

\n

Best regards, Marco

{html}", "updateAuthor": { "name": "marco.schierhorn(atgmail)", "key": "marco.schierhorn(atgmail)", "displayName": "marco.schierhorn (at gmail)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:59:02.000+0000", "updated": "2011-04-15T02:59:02.000+0000" }, { "id": "126332", "author": { "name": "marco.schierhorn(atgmail)", "key": "marco.schierhorn(atgmail)", "displayName": "marco.schierhorn (at gmail)", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Here is the remoteFile.js File

{html}", "updateAuthor": { "name": "marco.schierhorn(atgmail)", "key": "marco.schierhorn(atgmail)", "displayName": "marco.schierhorn (at gmail)", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:59:03.000+0000", "updated": "2011-04-15T02:59:03.000+0000" }, { "id": "126333", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Hi Marco,

\n

Please add to your helpdesk ticket instead of here. The issue\ndescribed by the title of this lighthouse ticket really is\nresolved, so we should carry on with other problems (i.e., going\nthrough a file) via helpdesk.

\n

thank you,
\nBill

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T02:59:03.000+0000", "updated": "2011-04-15T02:59:03.000+0000" }, { "id": "126334", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

confirmed

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:59:03.000+0000", "updated": "2011-04-15T02:59:03.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }