{ "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.
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.
\nScreenshot of problem:
\nTest case (see me via e-mail for the URL for\nxhr.open()
-- it's not to be made public).
\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
\nScreenshot when fixed:
\nhttp://skitch.com/billdawson/dwk16/5560-titanium-5-hvga
(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...
Actually you can get the feed address from the problem\ndescription in helpdesk ticket 38891.
Hey Bill,
\nthanks 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.
\nMaybe 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.
\nBest regards, Marco
Here is the remoteFile.js File
Hi Marco,
\nPlease 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.
\nthank you,
\nBill
confirmed