Garbled characters appear when accessing Chinese via hibernate
When hibernate is used for project development, garbled characters may occur when you modify and save Chinese characters. Many people use Baidu, and copy and paste the code behind the data connection, as shown in <property name = "connection. url "> jdbc: mysql: // localhost: 3306/tansinglepage </property>: <property name =" connection. url "> jdbc: mysql: // localhost: 3306/tansinglepage? UseUnicode = true & amp; characterEncoding = UTF-8 </property> but note that jdbc: mysql: // localhost: 3306/heshenghuo? UseUnicode = true & amp; characterEncoding = UTF-8 this is only applicable to xml files, if you configure it as a properties file, read the data. It will not work, and garbled characters will still appear. In the properties file, do the following: jdbc: mysql: // localhost: 3306/heshenghuo? UseUnicode = true & characterEncoding = UTF-8