{"action":"closed","issue":{"url":"https://api.github.com/repos/angular/angular/issues/5463","labels_url":"https://api.github.com/repos/angular/angular/issues/5463/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/5463/comments","events_url":"https://api.github.com/repos/angular/angular/issues/5463/events","html_url":"https://github.com/angular/angular/issues/5463","id":118682094,"number":5463,"title":"response.data is always converted to string under Chrome","user":{"login":"msummers-intrax","id":5215681,"avatar_url":"https://avatars.githubusercontent.com/u/5215681?v=3","gravatar_id":"","url":"https://api.github.com/users/msummers-intrax","html_url":"https://github.com/msummers-intrax","followers_url":"https://api.github.com/users/msummers-intrax/followers","following_url":"https://api.github.com/users/msummers-intrax/following{/other_user}","gists_url":"https://api.github.com/users/msummers-intrax/gists{/gist_id}","starred_url":"https://api.github.com/users/msummers-intrax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msummers-intrax/subscriptions","organizations_url":"https://api.github.com/users/msummers-intrax/orgs","repos_url":"https://api.github.com/users/msummers-intrax/repos","events_url":"https://api.github.com/users/msummers-intrax/events{/privacy}","received_events_url":"https://api.github.com/users/msummers-intrax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-24T19:11:21Z","updated_at":"2015-11-24T21:02:09Z","closed_at":"2015-11-24T21:02:09Z","body":"Downloading Word & PDF docs via a REST API response.data is always converted to string and the extended characters are 'decoded'. This only happens on Chrome, Firefox & IE (current) work as expected. \r\n\r\nAs this maybe an XMLHttpRequest problem I've also reported it to Chrome.\r\n\r\n```\r\n            var _config = {\r\n              responseType: 'arraybuffer'\r\n            };\r\n\r\n           var success = function (data, status, header, config) {\r\n             $log.debug('Download resume success ');\r\n             var _contentType = (header('Content-Type'));\r\n             _contentType = _contentType.substring(0,_contentType.indexOf(\";\"));\r\n             var blob = new Blob([data], {type: _contentType});\r\n             var url = (window.URL || window.webkitURL).createObjectURL(blob);\r\n             var anchor = angular.element('<a/>');\r\n              anchor.attr({\r\n              href: url,\r\n              target: '_blank',\r\n              download: _fileName\r\n              })[0].click();\r\n            }\r\n\r\n            var error = function (e) {\r\n               if(e != null) {\r\n                 bootbox.alert('Error encountered when downloading resume ');\r\n                 $log.debug('Downloading error ' + JSON.stringify(e));\r\n               }\r\n            };\r\n\r\n           $http.get(_url, _config).success(success).error(error);\r\n```\r\n"}}