use curl_httpclient
fix unicode error
write to file