Passing arabic string using cURL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
frankiejr
Forum Newbie
Posts: 6
Joined: Tue Jul 21, 2009 5:39 pm

Passing arabic string using cURL

Post 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.
iloveoct2
Forum Newbie
Posts: 2
Joined: Wed Oct 28, 2009 1:41 am

Re: Passing arabic string using cURL

Post 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",
));
Post Reply