Chinese garbled characters in MySQL4.0

Source: Internet
Author: User

We all know that MySQL4.0 has Chinese garbled characters in actual operations. The following articles mainly describe the actual operation solution to solve the Chinese garbled characters in MySQL4.0, if you are interested in the actual operation method, you can click the following article.

Not long ago, MySQL database + asp. net2.0 was used in project development. This is the first time I used MySQL, and I had to use MySQL due to customer requirements.

Project development encountered Chinese Input and Output garbled, on the Internet also google a few articles, probably know the reason; that is, MySQL will encode it as "ISO-8859-1" for storage, when there is no way to store and read Chinese data in the program, the first "ISO-8859-1" and "gb2312" between the conversion. In this way, Chinese garbled characters can be solved.

Convert ISO-8859-1 encoding to gb2312 Code as follows:

 
 
  1. Var temp = Encoding. GetEncoding ("ISO-8859-1"). GetBytes (strInput );
  2. Return Encoding. GetEncoding ("gb2312"). GetString (temp );

I used the most stupid method to solve the problem of Chinese garbled characters in MySQL4.0. We also hope that you will have a better way to learn. Ha

Tip: MySQL can solve Character Set problems. You can specify a table or a separate field.

The above content is the description of MySQL4.0 Chinese storage, hoping to help you in this regard.

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.