Im有一個捲曲問題: 我從Mysql(城市名稱)獲得數據,其編碼格式爲ascii HEX(例如%DF爲ß或%DC爲ü)。 我用str_replace()轉換它們;到德國變音(ß,ü,ä,ö)。 我得到一個錯誤,當我用捲曲發送數據(城市)。(「從正確的填寫!」)CURL in PHP URL w/Umlauts
當我發送數據,而無需變音(ä,ö,ü,ß),一切都很好! 我的代碼或curl有什麼問題。我也嘗試過w/shell - 同樣的問題!
$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);
最好,meeeeeh!
他們_應該urlencoded ....你爲什麼還原呢? – Wrikken