Java Web database Chinese garbled problem

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
Preparation of Java Web project has encountered a problem when fill in Chinese data, the database is acceptable????? Chinese, garbled, because JSP Chinese encoding and the default web server, the browser code is not consistent, check some information, I do:
1 check each JSP page charset=gb2312,
Each of the 2 servlet pages using request.setCharacterEncoding("gb2312"),
3 in each JavaBean page to get the value of the use of
  String xxx =  new String(xxx.getBytes("ISO-8859-1"), "UTF-8");
(at that time a little get desperation..)
Write 4 of each servlet page

But the tragedy is that it does not solve the problem, and I noticed that my data from input to pass the servlet examination is no problem, but when the last incoming database is garbled, finally come to the conclusion that... When MySQL installed is one option is to choose the language, I did not pay attention to direct continue at the time, is the question, when you install MySQL remember to choose in the options such as utf8 or GB2312.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Andrew at December 12, 2013 - 8:07 PM