garbled problem

This situation is caused by the different encoding format of the code written in Eclipse and the encoding format set in MySQL.
  1. You must first figure out the encoding format of the project on Eclipse and the corresponding database in MySQL.
  2. For example, Eclipse is GBK , and database is utf8. At this time, you can either right-click the project you want to change, then go to Properties, find the Resource panel, there is Text file encoding on it, and rewrite it to UTF-8.
  3. It is a little complicated to change the MySQL database. You can download the SQLlog Enterprise Edition. After connecting to the database, right-click to change the database, and you can change it to gbk format.
  4. This will cause the existing Chinese format in the corresponding project or database to be garbled. Therefore, the final solution, and what needs to be paid attention to in development, is to set the default format of the Eclipse workspace and the format of the database to be unified as UTF-8. Compatible with English and Chinese formats.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324384365&siteId=291194637
Recommended