Inserting Chinese characters is garbled. I tried many methods. For example, I first set vim to: set fileencoding=utf-8 but it didn’t work. Then I thought about it and it was right. It has nothing to do with vim
Then I tried c# code and used Encoding The .UTF8.GetString() method was also incorrect later.
I was depressed, and suddenly I thought it was a problem with mysql settings? ? ?
So, sudo nano /etc/mysql/my.cnf
Insert the following red code, default-character-set = utf8, success, no garbled characters~~~No need for encoding at all.....
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mys qld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/ mysqld.sock
default-character-set = utf8
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = / usr/share/mysql/english
skip-external-locking