Project: titanium
Issue TIMOB-6922: Android: Network - HTTPClient cannot retrieve non-ascii data
h2. Problem When loading some JSON file (UFT-8) from the web and displaying the data, the Non-Ascii-chars text is garbled. See attached screenshot of this problem on 1.7.2 Note that this works fine on iPhone. The Kitchen Sink Demo of XHR has the same problem. It works on the iPhone but fails on Android. h2. Test case {code:lang=javascript|title=app.js} Ti.UI.setBackgroundColor('#ddd'); var win = Ti.UI.createWindow({}); var loadDataButton = Ti.UI.createButton({ title: "Let's load UTF-8 from the web!", width: 260, top: 50, height: 40 }); win.add(loadDataButton); loadDataButton.addEventListener('click', function() { var test1 = loadFromWeb("http://crossplattformvergleich.dnsalias.org/test.js"); /* file contains in UTF8: { "result" : "áäüÖßÉ?" } and a comment */ var test2 = loadFromWeb("http://crossplattformvergleich.dnsalias.org/test2.js"); /* this is a 36-byte file. Appears as 0 bytes on android */ }); function loadFromWeb(url) { var asyncRequest = Ti.Network.createHTTPClient(); asyncRequest.timeout = 30*1000; asyncRequest.open("GET", url); asyncRequest.onload = loadCallback; asyncRequest.send(); } function loadCallback() { alert(this.responseText); } win.open(); {code} h2. Discussions Q&A: [problem fetching uft-8 content on android|http://developer.appcelerator.com/question/126712/problem-fetching-uft-8-content-on-android#comment-101538]
Story points: 2