Im having a problem with curl:
I get data from Mysql (City names) with umlauts coded in ascii HEX (e.g. %DF for ß or %DC for ü ).
i convert them with str_replace(); to german Umlauts (ß,ü,ä,ö).
i get an error when i send the data (the cities) with curl.(“fill in the from correct!”)
when i send data WITHOUT Umlauts (ä,ö,ü,ß) everything is fine!
Whats wrong with my code or with curl. I also tried it w/ shell – same problem!
$this->url = "blah.org/?params=diesdas&city_from=Straßbourg&City_to=München";
$this->ckfile = tempnam("/tmp", "cookie");
$this->ch = curl_init();
curl_setopt($this->ch,CURLOPT_URL, $this->url);
curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($this->ch, CURLOPT_PROXY, "46.4.248.80");
curl_setopt($this->ch, CURLOPT_PROXYPORT, "3128");
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($this->ch, CURLOPT_COOKIEJAR, $this->ckfile);
echo 'getting cookie file...';
$cookie = curl_exec($this->ch);
if($cookie = false){echo 'couldn\'t get cookie!<br> '.curl_error($this->ch);}else{echo 'got cookie! omnomnom!<br>';}
$this->ch = curl_init("blah.com/sendcookietome");
curl_setopt($this->ch, CURLOPT_COOKIEFILE, $this->ckfile);
curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($this->ch, CURLOPT_PROXY, "46.4.248.80");
curl_setopt($this->ch, CURLOPT_PROXYPORT, "3128");
curl_exec($this->ch);
best, meeeeeh!
I got it to work:
wow.wtf?
this link works for ‘ß’:
blah.org/&from_spar=Straßburg&to_spar=Kiel+Hbf
blah.org/&from_spar=Köln+Hbf&to_spar=Stuttgart+Hbf
Thats how it is accepted.