[TIMOB-8369] iOS: Titanium.Network.HTTPClient cannot parse Windows-1255 encoded pages
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 2.0.1, Release 3.1.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Gilad Novik |
Assignee | Unknown |
Created | 2012-03-16T19:12:53.000+0000 |
Updated | 2018-03-06T18:57:54.000+0000 |
Description
Problem Description
When using HTTPClient to fetch Hebrew pages, the resulting string is null.Actual Results
Result is null, even if you got something from the webservice.Expected results
Working fine.Test Case
var win = Ti.UI.createWindow();
var client = Ti.Network.createHTTPClient({
onload : function(e) {
Ti.API.info(this.responseText); // this will always output 'null'
}
});
client.open("GET", 'http://rotter.net/cgi-bin/listforumf.pl');
client.send();
win.open();
Objective-C code will try to guess the right encoding, but windows-1255 is not available in the list. titanium_mobile / iphone / Classes / TiNetworkHTTPClientProxy.m:
The following line will add Windows-1255 support:
Apparently Android has a similar bug. responseText does have a value - but it was using the wrong encoding to convert, resulting in a useless string.
Tested with 2.0.1GA2 on the iOS simulator, issue still exists.
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0