title: urlencoding Chinese character to url
body: <p>I'm trying to translate a chinese character to english but i think there is issue when it comes to encoding.</p>
  
  <p>How do i pass the Chinese character to Microsoft so they can translate it and return me the text in English? I cant seem to send the Chinese characters over because of the encoding? I tried detecting the encoding type.</p>
  
  <p>Chinese Character in $completeColours</p>
  
  <pre><code>橘色,灰色,深蓝,绿色
  </code></pre>
  
  <p>URLencoded text
      %26%2327224%3B%26%2333394%3B%2C%26%2328784%3B%26%2333394%3B%2C%26%2328145%3B%26%2334013%3B%2C%26%2332511%3B%26%2333394%3B</p>
  
  <p>returned result</p>
  
  <pre><code>&amp;#27224;&amp;#33394;,&amp;#28784;&amp;#33394;,&amp;#28145;&amp;#34013;,&amp;#32511;&amp;#33394;
  </code></pre>
  
  <p>Code</p>
  
  <pre><code>// Prepare variables
  $text = urlencode($completeColours);
  echo $text;
  $from = 'zh-CHT';
  $to = 'en';
  
  // Prepare cURL command
  $key = 'xxx';
  $ch = curl_init('https://api.datamarket.azure.com/Bing/MicrosoftTranslator/v1/Translate?Text=%27'.$text.'%27&amp;From=%27'.$from.'%27&amp;To=%27'.$to.'%27');
  
  curl_setopt($ch, CURLOPT_USERPWD, $key.':'.$key);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
  
  // Parse the XML response
  $result = curl_exec($ch);
  $result = explode('&lt;d:Text m:type="Edm.String"&gt;', $result);
  $result = explode('&lt;/d:Text&gt;', $result[1]);
  $result = $result[0];
  
  echo $result;
  </code></pre>