| From | Sent On | Attachments |
|---|---|---|
| Merijn van den Kroonenberg | Aug 26, 2002 5:36 am | |
| Merijn van den Kroonenberg | Aug 26, 2002 7:10 am | |
| Joshua Alexander | Aug 27, 2002 9:13 pm | |
| Merijn van den Kroonenberg | Aug 28, 2002 12:30 am | |
| Merijn van den Kroonenberg | Aug 28, 2002 7:17 am |
| Subject: | Re: [PHP] curl and UTF-8, follow up | |
|---|---|---|
| From: | Merijn van den Kroonenberg (meri...@e-factory.nl) | |
| Date: | Aug 28, 2002 7:17:00 am | |
| List: | net.php.lists.php-general | |
Hi,
This problem is solved now (thanks Wez Furlong). The problem was, that i had the mbstring php module enabled (check with phpinfo). By default this module encodes input data. After i added the following lines to the php.ini the problem was solved: mbstring.http_input = pass; mbstring.http_output = pass;
bottomline, be carefull when activating this module, it might do more than you expect ;-)
Merijn
----- Original Message ----- From: "Merijn van den Kroonenberg" <meri...@e-factory.nl> To: <php-...@lists.php.net> Sent: Monday, August 26, 2002 4:10 PM Subject: [PHP] curl and UTF-8, follow up
I did some further testing, and i found that this behaviour is not consistent. Actually i am pretty puzzled about this.
When i wrote the message below is was testing with a xml document that contained only the following multi byte utf chacracter: \303\253 (octal utf8) (LATIN SMALL LETTER E WITH DIAERESIS) The output from CURL got automatically decoded to latin1.
Then after i wrote the message i tested with another xml document that contained the following multi byte utf character: \342\202\254 (octal utf8) (EURO SIGN) I was suprised to see that the output was now correct UTF-8.
Now i modified the first document and inserted the EURO SIGN in this document. When i process this document again, the CURL output is UTF-8. So it seems the output of CURL depends on what it detects on its imput, and it will try to convert the data to latin1 if possible??
Does anyone know how i can disable this behaviour? For me, CURL should not do any encoding of my data.
Greetings, Merijn van den Kroonenberg
----- Original Message ----- From: "Merijn van den Kroonenberg" <meri...@e-factory.nl> To: <php-...@lists.php.net> Sent: Monday, August 26, 2002 2:36 PM Subject: [PHP] curl and UTF-8
Hello List,
I have a problem with the php CURL module and UTF-8 data. My php script uses curl to do a post to a perl/cgi script. This perl script returns UTF-8 encoded XML. The perl script returns utf-8, i have verified that using the webserver logfiles, but the data that i receive in $result (see below) is decoded to ISO-8859-1.
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $post_url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); $result = curl_exec ($ch);// #### UTF compatible? curl_close ($ch);
Anyone an idea how i can get curl to return me UTF-8 data?
Thank you,
Merijn van den Kroonenberg
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php





