Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-9558

iOS: XHR calls fail if the response data has invalid encoding

    Details

      Description

      Problem description

      XHR calls fail if the response data has invalid encoding

      Steps to reproduce and sample code

      Run the sample code using the url provided in the bug comments below
      Result: responseText it's null

      This behavior it's only reproducible with the provided url page.
      The page it's recognized from the browser as encoded with Western (ISO-8859-1). Encoding it with Unicode (UTF-8) would solve the issue and response text it's returned as expected.

      var win = Titanium.UI.createWindow({
      	title:'test',
      	backgroundColor:'white'
      });
       
      var xhr = Titanium.Network.createHTTPClient({
      	enableKeepAlive: true,	
      });
       
      xhr.onerror = function(e) {
          Ti.API.error('#### Error received while requesting intraday data: ' + JSON.stringify(e));
      };
       
      xhr.onreadystatechange = function(e) {
      	Ti.API.info("#### " + this.readyState);
      };
       
      xhr.onload = function(e) {
          if(this.status == 200) {
              Ti.API.info('#### response text: ' + this.responseText);
          }
      };
      xhr.open('GET', "SEE COMMENT FOR URLs");
      xhr.send();
       
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                fcasali Federico Casali
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-13710
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration