PHP http Communication

Source: Internet
Author: User
1. $STRR 2=$_cookie[' log ']; The application (written by MFC) sends a string of log

There are foreign countries, such as Korean, Japanese, and minority languages, Chinese and English. The application turns two bytes into a byte to the web, and then PHP accepts the code as the first line, and then I'm going to use the code to convert it so that the languages are displayed properly on the page. I know that the Web page is Utf-8 can be displayed. is how to convert from one byte of an application to UTF-8 format.


Reply to discussion (solution)

The application sends two bytes into a byte to the Web???
So you lost the information? How can it be restored?

function ConvToUtf8 ($str) {     if (mb_detect_encoding ($str, "UTF-8, Iso-8859-1, GBK")! = "UTF-8")     {         return Iconv ("GBK", "Utf-8", $str);     } else {         return $str;     
  • 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.