Page 1 of 1

Passing arabic string using cURL

Posted: Wed Oct 28, 2009 12:40 am
by frankiejr
Hello,

I am trying to post data using CURL .. but i can't get arabic charaters to pass correctly.

here is my script:

Code: Select all

// Create a curl handle
$ch = curl_init();
 
    curl_setopt($ch, CURLOPT_URL,"$address");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "MessageBody=$msg_body");
 
// Execute
curl_exec($ch);
 
// Close handle
curl_close($ch);

where $msg_body contains arabic characters.

Re: Passing arabic string using cURL

Posted: Wed Oct 28, 2009 2:00 am
by iloveoct2
This POST is the normal application/x-www-form-urlencoded kind.

curl_setopt($cURL,CURLOPT_HTTPHEADER,array (
"Content-Type: text/xml; charset=utf-8",
));