2012-02-25 25 views
5

我有一個小問題與PHP捲曲發佈。PHP捲曲文章與非英文字符

我想發佈一些土耳其人的論壇,但不張貼它應該如何。

這是我如何保存文本:

 

    fwrite($fpp,"\xEF\xBB\xBF"); 
    fwrite($fpp, $row['template']); 
    fclose($fpp); 

和張貼:

$this->curl = curl_init(); 
    curl_setopt ($this->curl, CURLOPT_URL, $this->vb_url . 'newthread.php?' . $url_vars); 
    curl_setopt ($this->curl, CURLOPT_POST, true); 
    curl_setopt ($this->curl, CURLOPT_POSTFIELDS, $post_fields); 
    curl_setopt ($this->curl, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt ($this->curl, CURLOPT_CONNECTTIMEOUT,20); 
    curl_setopt ($this->curl, CURLOPT_TIMEOUT,10); 
    curl_setopt ($this->curl, CURLOPT_HEADER, true); 
    curl_setopt ($this->curl, CURLOPT_FOLLOWLOCATION, 0); 
    curl_setopt ($this->curl, CURLOPT_COOKIE, $this->cookie_name); 
    curl_setopt ($this->curl, CURLOPT_COOKIEJAR, $this->cookie_name); 
    curl_setopt ($this->curl, CURLOPT_COOKIEFILE, $this->cookie_name); 
    curl_setopt ($this->curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1'); 
    $result = curl_exec ($this->curl); 

這是應該的:

`Bölüm resimleri, dizi indirme ve altyazı linkine aşağıdan ulaşabilirsiniz.`

這是怎麼了已張貼:

`Bölüm resimleri, dizi indirme ve altyazı linkine aşağıdan ulaşabilirsiniz.`

感謝

+0

你是垃圾郵件發送者嗎? – 2012-02-27 20:55:07

+2

垃圾郵件發送者?你如何得出這個結論?只是因爲我問了一個PHP函數的幫助? – gtht90 2012-03-01 16:03:31

回答

2

建議修正了

$message = @iconv("UTF-8","Windows-1252//IGNORE",$message); 
1

http://php.net/manual/es/function.curl-setopt.php

嘗試增加:

curl_setopt($this->curl,CURLOPT_HTTPHEADER,array (
    "Content-Type: application/x-www-form-urlencoded; charset=utf-8" 
)); 

application/x-www-form-urlencoded通過@spencercw

+0

不起作用。我收到「您的提交無法處理,因爲安全令牌丟失。」 – gtht90 2012-02-25 16:17:01

+1

我猜你需要一個'application/x-www-form-urlencoded'而不是'text/xml'的內容類型。 – spencercw 2012-02-25 16:31:21

+0

您的'$ post_fields'變量是否包含'securitytoken'條目? – seanbreeden 2012-02-25 16:31:46