Home > front end >  Data output Chinese garbled
Data output Chinese garbled

Time:09-16

我编写一个学生管理系统,输入信息,点击提交,出现的中文出现乱码,查看MySQL数据库,发现插入的数据已经乱码,jsp内charset=''utf-8''也都有,但是还是解决不了,有没有哪位大神可以解决一下

CodePudding user response:

And in the back of the database name? CharacterEncoding=utf-8 "give it a try

CodePudding user response:

Debug, the look is in the front-end and back-end gibberish, or in the back-end database garbled

CodePudding user response:

reference 1st floor usecf response:
in the name of the database behind plus? Try characterEncoding=utf-8 "

Still no good ah, but or thank you??

CodePudding user response:

refer to the second floor asd105574 response:
debug, see in the front-end and back-end garbled, or transmit the backend database garbled

Debug I tried, but can not see clearly, no error message

CodePudding user response:

1. Write a character filter, default is iso - 8859-1, to guarantee the transmission of a character encoding in
If use spring MVC can use org. Springframework. Web. Filter. CharacterEncodingFilter (" utf-8 ", true)
If tomcat can use the built-in org. Apache. Catalina. Filters. AddDefaultCharsetFilter

Database
2.Library and the table of a character encoding
JDBC connection, it is suggested that based on database driven version you use.

3. Display the code
Caused by encoding do not agree with 1, 2 page
  • Related