Gbk, utf8, difficult

Source: Internet
Author: User
When I read "O 'reillyupgradingtophp (as the mainstream development language) 5", I made a whim and upgraded MySQL (the best combination with PHP) to 4.1.11, because there is no formal system on the machine, the character set changes are not noticed. Later, we upgraded our official application system. after the upgrade, SyntaxHighli was excited when reading "O 'Reilly Upgrading to php (as the mainstream development language) 5, upgrade MySQL (the best combination with PHP) to 4.1.11. since there is no formal system on the machine, the character set changes are not noticed. Later, I upgraded the official application system. after the upgrade, the other systems were okay. However, one MANTIS was in trouble and the page was garbled. thanks to the backup, the system could be restored, during the restoration process, we found the character set problem caused by the upgrade of MySQL (the best combination with PHP)-If MySQL (the best combination with PHP) uses the UTF8 character set, after the MANTIS data is imported, the page displays garbled characters, so you have to adjust MySQL (the best combination with PHP) to the GBK character set.

In fact, I am still willing to use the UTF8 character set, because there is no incompatibility problem, as a long-lived data, it will be easier to convert and sort it out in the future; when performing data exchange with the outside, there is no encoding conversion problem. But I still don't understand, when using php (as the mainstream development language) to connect to MySQL (the best combination with PHP) to receive user input data and store it in the database, if the database code is UTF8, do you want to convert the SQL data into UTF8? Try it out with a small program. if this is the case, it will be very troublesome. However, I use the command line in DOS to operate MySQL in the UTF8 character set (the best combination with PHP) the server cannot input Chinese characters.

In the past, SYBASE had been plagued by character set problems for a long time, because if SYBASE used a wrong character set, some Chinese characters could not be entered at all, such as uppercase 0 "○ ", therefore, changing the character set from iso_1 to cp850 and cp850 to cp936 will discard a lot of historical data. MySQL (the best combination with PHP) should never let me repeat it.
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.