Remove latin1 encoded characters from MySQL, display garbled output, PHP How to convert to UTF8 format?

Source: Internet
Author: User
Keywords Php latin1
Tags html header
Remove latin1 encoded characters from MySQL, display garbled output, PHP How to convert to UTF8 format?

Reply content:

Remove latin1 encoded characters from MySQL, display garbled output, PHP How to convert to UTF8 format?

PHP itself only supports Utf-8

iconv("GBK//IGNORE", "UTF-8", $content);

Database Editor HTML header encoding must be checked one by one if the database encoding is not UTF8, then re-insert the code.

PHP processing problem is not big, with what code plug on what code to take. There was a burst of dealing with the old code, as was the case with the Lord.
is to use the client query is not good.
I guess the landlord may have forgotten "set names UTF8".

However, if the data is not much, it is recommended that you convert the data, database schema character set, and table character set.

  • 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.