c - CURL - Change encoding to windows-1253 while downloading file -


i having problem while downloading , saving page source, using curl library in c. program runs without problems, , file downloading successfully. although page's charset encoding windows-1253 (with greek characters), file program writes page's source, displays character: � wherever greek letter should be.

so, there additional option can add in curl_easy_setopt() function in order change charset encoding?


here function downloads the page source :

char * url

and saves into:

char * file_name


int download_page(char * url,char * file_name){         curl *curl;         curlcode curl_res;         int ret;         file *temp;          if(url == null)                 return 0;          temp=fopen(file_name, "w");         if(temp==null)                  return 0;          curl = curl_easy_init();         curl_easy_setopt(curl, curlopt_url, url);         curl_easy_setopt(curl, curlopt_writedata,  temp);          curl_res = curl_easy_perform(curl);         if(curl_res==0)                   ret = 1;         else                 ret = 2;          fclose(temp);         curl_easy_cleanup(curl);          return ret; } 

it's first time use curl, appreciated...


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -