{"action":"created","issue":{"url":"https://api.github.com/repos/n1k0/casperjs/issues/777","labels_url":"https://api.github.com/repos/n1k0/casperjs/issues/777/labels{/name}","comments_url":"https://api.github.com/repos/n1k0/casperjs/issues/777/comments","events_url":"https://api.github.com/repos/n1k0/casperjs/issues/777/events","html_url":"https://github.com/n1k0/casperjs/issues/777","id":24627010,"number":777,"title":"casperjs download file character encoding utf8 issue","user":{"login":"hsnelamir","id":5874823,"avatar_url":"https://avatars.githubusercontent.com/u/5874823?v=3","gravatar_id":"","url":"https://api.github.com/users/hsnelamir","html_url":"https://github.com/hsnelamir","followers_url":"https://api.github.com/users/hsnelamir/followers","following_url":"https://api.github.com/users/hsnelamir/following{/other_user}","gists_url":"https://api.github.com/users/hsnelamir/gists{/gist_id}","starred_url":"https://api.github.com/users/hsnelamir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsnelamir/subscriptions","organizations_url":"https://api.github.com/users/hsnelamir/orgs","repos_url":"https://api.github.com/users/hsnelamir/repos","events_url":"https://api.github.com/users/hsnelamir/events{/privacy}","received_events_url":"https://api.github.com/users/hsnelamir/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/n1k0/casperjs/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/n1k0/casperjs/labels/Qualified","name":"Qualified","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/n1k0/casperjs/milestones/5","html_url":"https://github.com/n1k0/casperjs/milestones/1.1","labels_url":"https://api.github.com/repos/n1k0/casperjs/milestones/5/labels","id":234085,"number":5,"title":"1.1","description":"","creator":{"login":"n1k0","id":41547,"avatar_url":"https://avatars.githubusercontent.com/u/41547?v=3","gravatar_id":"","url":"https://api.github.com/users/n1k0","html_url":"https://github.com/n1k0","followers_url":"https://api.github.com/users/n1k0/followers","following_url":"https://api.github.com/users/n1k0/following{/other_user}","gists_url":"https://api.github.com/users/n1k0/gists{/gist_id}","starred_url":"https://api.github.com/users/n1k0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n1k0/subscriptions","organizations_url":"https://api.github.com/users/n1k0/orgs","repos_url":"https://api.github.com/users/n1k0/repos","events_url":"https://api.github.com/users/n1k0/events{/privacy}","received_events_url":"https://api.github.com/users/n1k0/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":53,"state":"open","created_at":"2012-12-23T06:53:14Z","updated_at":"2015-04-20T14:15:24Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2013-12-20T14:56:03Z","updated_at":"2015-05-28T11:10:28Z","closed_at":null,"body":"I'm trying to download the following csv file using casperjs\r\n\r\n```js\r\nvar casper = require('casper').create({});\r\ncasper.start('http://69.50.252.196/');\r\ncasper.then(function(){\r\n    this.download('http://69.50.252.196/download.csv', 'downloaded.csv');\r\n});\r\ncasper.run(function() {\r\n    this.exit();\r\n});\r\n```\r\n\r\ndownload.csv\r\n\r\n```\r\nإختبار  Arabic\r\nآزمایشی Persian\r\n测试  Chinese\r\n測試  Chinese\r\nиспытание   Russian\r\nपरीक्षा Hindi\r\nδοκιμή  Greek, Modern (1453-)\r\n테스트 Korean\r\nטעסט    Yiddish\r\nテスト Japanese\r\nபரிட்சை Tamil\r\n```\r\n\r\nbut the downloaded file always corrupted and got corrupted characters\r\n\r\ndownloaded.csv\r\n\r\n```\r\n\"%.*('1 Arabic\" \r\n\"2E'ج4ج Persian\r\nKص  Chinese\r\n,f  Chinese\r\n8A?KB0=85   Russian\r\n*0@\u0015M7> Hindi\r\n´؟؛¹¼®  Greek\"   Modern (1453-)\"\r\n\"L¤¸    Korean\" \r\n\"طâلط   Yiddish\"    \r\n\"ئ¹ب    Japanese\"   \r\n\"ھ°؟ںحڑب    Tamil\"  \r\n```\r\n\r\n```\r\ncasperjs --version\r\n1.1.0-beta3\r\nphantomjs --version\r\n1.9.2\r\n```"},"comment":{"url":"https://api.github.com/repos/n1k0/casperjs/issues/comments/106279175","html_url":"https://github.com/n1k0/casperjs/issues/777#issuecomment-106279175","issue_url":"https://api.github.com/repos/n1k0/casperjs/issues/777","id":106279175,"user":{"login":"paazmaya","id":369881,"avatar_url":"https://avatars.githubusercontent.com/u/369881?v=3","gravatar_id":"","url":"https://api.github.com/users/paazmaya","html_url":"https://github.com/paazmaya","followers_url":"https://api.github.com/users/paazmaya/followers","following_url":"https://api.github.com/users/paazmaya/following{/other_user}","gists_url":"https://api.github.com/users/paazmaya/gists{/gist_id}","starred_url":"https://api.github.com/users/paazmaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paazmaya/subscriptions","organizations_url":"https://api.github.com/users/paazmaya/orgs","repos_url":"https://api.github.com/users/paazmaya/repos","events_url":"https://api.github.com/users/paazmaya/events{/privacy}","received_events_url":"https://api.github.com/users/paazmaya/received_events","type":"User","site_admin":false},"created_at":"2015-05-28T11:10:28Z","updated_at":"2015-05-28T11:10:28Z","body":"The current code:\r\n```\r\nfs.write(targetPath, cu.decode(this.base64encode(url, method, data)), 'wb');\r\n```\r\nas discussed above"}}