Navicat solve connect to the database (Mysql) appear in Chinese garbage problem

To realize the connection does not appear garbled must remain the same at both ends of the character set;

We generally refer to when encoding character set is UTF-8;

Why use the UTF-8 character set?

If all countries have come up with its own set of coding standards, the results of each other who do not know who coding, coding the support of others who do not. At that time the Chinese people want the computer to display Chinese characters, it must be fitted with a "system of Chinese characters", designed to handle the display of Chinese characters, the problem input, wrong character system, the display will be in total chaos. How to do this? Just then, a man named  ISO  international organization (International Standards Organization who) decided to address this problem. They used very simple: scrap all regional coding scheme, including a re-engage all cultures on Earth, encoding all letters and symbols! They plan to call it "Universal Multiple-Octet Coded Character Set ", referred to as the UCS, commonly known as " UNICODE ."

When UNICODE began to develop, the memory capacity of the computer has greatly developed, the space no longer become a problem. ISO then be directly specified by two bytes, i.e. 16 to unify all the characters represented, ascii for those in the "half-size" character, the UNICODE encoding embracing its original unchanged, but its length is from 8 extended to 16 bits, and the character of other cultures and languages ​​are all re-unified coding. Since the "half-size" need to use English symbols only the lower 8 bits, so its high eight is always 0, so this program when you save the atmosphere of the English text will be more than double the waste of space.

However, UNICODE is not considered in the formulation to maintain compatibility with any existing coding scheme, he can combine a total of 65535 different characters, which probably can already cover the symbol of all cultures in the world.

Note that this is only the unicode characters are defined to represent all 1-65536, it is also not considered a problem specific computer storage how how parse.

First is to achieve unicode UTF-8, and adapt to the world all the characters.

 UTF-8 is followed by variable length, according to the different characters 1-3 bytes, Unicode A is 1-8 bytes to store relatively utf-16, utf-32 to save storage space

Back to the topic

First check your mysql coding

Mysql into the small black box

View command input character set

show variables like '%char%';

Because I is modified so here is something latin1 utf8, then the general is not set display;

First, we need to modify the configuration file my.ini

Add default-character-set in the [client] at = utf8

Add default-character-set at [mysql] = utf8

Add / modify character_set_server = utf8, in [mysqld] the effect after the restart service

Then there Navicat end design table -> Edit Character Set

Display the correct characters after the modification is completed.

 

Published 21 original articles · won praise 7 · views 20000 +

Guess you like

Origin blog.csdn.net/qq_40662239/article/details/90607969