Questions about character encoding

Source: Internet
Author: User
Tags php editor
About the character encoding problem my database (mysql database software) uses utf8 and each table in it is also utf8 and the type of general_ci; & nbsp; my php editor uses the UTF-8 encoding method. The browser also uses the UTF-8 encoding method. after operations on the webpage, the browser submits the code to the database through php, the data in the database is about character encoding.
My database (mysql database software) uses utf8 and each table in it is also utf8 and the type of general_ci;
My php editor uses UTF-8 encoding;
The browser also uses UTF-8;

After the operation on the web page is submitted to the database through php, the data in the database becomes garbled "å ½ ± §? Å ¨ ±ä¹ "(similar to this garbled code)

In addition, inputting normal encoding data in the database is also garbled when it is displayed in the browser.

I don't know what the problem is. At first I had a problem with the thinkphp template, but I connected the database and operated it with the original (self-written, there is still a garbled problem...

I really don't know why ..
Please give advice

------ Solution --------------------
Set names 'utf8'; is execution performed?
------ Solution --------------------
Set names 'utf8 ';
------ Solution --------------------
It should be a problem with the TP framework...
To pick up points...
------ Solution --------------------
I don't know what's going on with you, but I have never encountered any problems using the following methods:
1. set the character set of the database to utf8
2. when connecting to the database, use mysql_set_charset ('utf8') or set the character set during connection.
3. set the text character set of the editor to utf8.
4. set the http header content-type = text/html; charset = utf-8

Hope to help you

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.