Thursday, 15 January 2015

php - urlencoding Chinese character to url -


I am trying to translate a Chinese character into English, but I think that when it comes to encoding , Then the problem occurs.

How do I pass Chinese characters to Microsoft, so that they can translate it and return the text to me in English? I am unable to send Chinese characters due to encoding? I tried to detect the encoding type.

Chinese Characters Caller in $ full

  æ © ?? È ?? ² ?? ²? ²? ²? ², æ · ± È ????, ç »¿è ?? ²   

URL code% 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

return results

  & amp; ; # 27224; & Amp; # 33,394 ;, & amp; # 28784; & Amp; # 33,394 ;, & amp; # 28145; & Amp; # 34013 ;, & amp; # 32511; & Amp; # 33,394;   

Code

  // Generate variables $ text = urlencode ($ Full Collars); Repeat $ text; $ = 'Zh-CHT'; From $ = 'n'; // make cURL $ command = key = 'xxx'; $ Ch = Curl_init ('https://api.datamarket.azure.com/bing/MicrosoftTranslator/v1/Translate?Text=%27'.$text.'%27&From=%27'.$from.'% 27 & amp; = 27% to 27% 27 ')' to $. '; Curl_setopt ($ CH, CURLOPT_USERPWD, $ key. ':'. $ Key); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, true); // Parsing XML response result $ curl_exec ($ ch); $ Result = explosion ('& lt; d: text m: type = "Adam String" & gt;', $ result); $ Result = explosion ('& lt; / d: text & gt;', $ result [1]); $ Result = $ result [0]; $ Return result;    

I am working on this subject and, to avoid it, I am compelled Having decided to write my Chinese users the address in English with secondary characters.

Like this:

MyPretty CMS Front Office Capture, Address Bar View address in

Here the menu editor" On the Fly "with Friendly URL Builder:

 MyPrettyCMS Friendly URL Menu Builder

I went with Badfood, Chrome and IE as you can see, Firefox is able to display Chinese symbols in the address bar , But chrome And if not IE, I ask myself, what is the best for SEO?

  • English?
  • As you do, use the code?
  • Use false language, but write phonetic Chinese symbol as Chinese input system?

    Now I choose the first option but I'm not sure that this is the best.

    There are 3 Captures:

    Baidu under IE < / P>

    Baidu under chrome

     Baidu under Firefox

No comments:

Post a Comment