I'd like to ask you a question about Php+mysql character encoding.

Source: Internet
Author: User
Want to set up the site to UTF8, check a lot of information, the truth also understand, the page, program, database character encoding unified together. The truth is clear, do not know how to do.

Web server space rented by someone else, MySQL config I can't control myself.


Page with the DREAMWEAVER5 design, the default encoding is exactly utf-8. What else needs to be done?


Reply to discussion (solution)

The front-end character set is not directly related to the character set saved by the database. Besides, the MySQL database supports multiple types of character sets, so as long as you choose the character set of the database to be UTF-8 when you install it, your data will be saved to the database according to UTF-8.

The database is human, you can not modify the settings
What you can do is
1, the establishment of the table when the text section plus a connection to proofread gbk_chinese_ci or utf8_general_ci
Tell MySQL what character set to store data in
2. After connecting to the database, execute set names GBK or set names UTF8 instruction
Tell MySQL what character set to use to communicate with him

Specifically, how to add a link to the Chinese text paragraph proofing?

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