How does the program and library code change to gb2312 by utf8?

Source: Internet
Author: User
How do I convert the program code from utf8 to gb2312? Or what is the idea? The library is large. There are more than 20 MB in SQL... must it be changed to gb2312? Is the database large? More than 20 M... why do we need to change? Since your program is UTF-8 encoded, if the database encoding changes the code of both the program and the library compilation code, how does it change to gb2312?
Is there any way? Or what is the idea?
The library is large. SQL contains more than 20 MB ....

------ Solution --------------------
Must it be gb2312? Is the database large? More than 20 M...
------ Solution --------------------
Why change?
Since your program is UTF-8 encoded, if the database encoding changes, it will cause "garbled"
If you want to change the program file to gbk, you only need to execute select names gbk to complete encoding conversion by the database.
------ Solution --------------------
A single table of GB indicates that the pressure is high .....

To modify a data table or database:
Alter table yourtablename default character set 'gb2312 ';


Corresponding, change the program ....
------ Solution --------------------
Discussion

A single table of GB indicates that the pressure is high .....

To modify a data table or database:
Alter table yourtablename default character set 'gb2312 ';


Corresponding, change the program ....

------ Solution --------------------
There is a tool for batch encoding conversion in the program.
------ Solution --------------------
You cannot change the default character of the table. remember that the existing fields will not change.
However, alter does.


20 MB of data. if you are too lazy, export the data (and change the size of the exported file to one or two places) and import the data again.


Discussion

A single table of GB indicates that the pressure is high .....

To modify a data table or database:
Alter table yourtablename default character set 'gb2312 ';


Corresponding, change the program ....

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.