Text garbled after two-dimensional code parsing

Source: Internet
Author: User
Two-dimensional code
After scanning, parsing is garbled.
After the UrlEncode is the following content
%c2%b0%c3%99%c2%b6%c3%88%c2%b0%c3%99%c2%bf%c3%86%c2%a3%c2%ad%c2%b6%c3%be%c3%8e%c2%ac%c3%82%c3%ab%c2%b4%c3%8a% C3%8c%c3%b5
I use scans to parse, but I can.
Content is "Baidu encyclopedia-two-dimensional code entry"
Is this code processed? How do you get the real results?


Reply to discussion (solution)

Http://cli.im/deqr
Using this parser is also

$s = '%c2%b0%c3%99%c2%b6%c3%88%c2%b0%c3%99%c2%bf%c3%86%c2%a3%c2%ad%c2%b6%c3%be%c3%8e%c2%ac%c3%82%c3%ab%c2%b4%c3% 8a%c3%8c%c3%b5 '; $s = urldecode ($s); Echo utf8_decode ($s);
Baidu Encyclopedia-two-dimensional code entry

The solved string is GBK encoded.

The great God appeared to solve the problem immediately,
Now there is a question, how should I judge when should use Utf8_decode?

So you can see that, okay?

$s = '%c2%b0%c3%99%c2%b6%c3%88%c2%b0%c3%99%c2%bf%c3%86%c2%a3%c2%ad%c2%b6%c3%be%c3%8e%c2%ac%c3%82%c3%ab%c2%b4%c3% 8a%c3%8c%c3%b5 '; $s = urldecode ($s), if (mb_check_encoding (' Utf-8 ')) {  $n = 0;  for ($i =0; $i
 
  
   
   strlen ($s)/2 * 0.8) $s = utf8_decode ($s);} echo $s;
 
  

In fact, the number of%c in the original string is the same.

I have just tried to use Mb_detect_encoding (Utf8_decode (' Assad asda ') = = ' ASCII ' to judge the need for
I don't know if this is accurate.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.