Today, I recorded a small problem: for example, the text box on the page or the obtained "Chinese value" is garbled, and then I went to the database to find it and returned an error! I found many methods and found that they are not applicable. The solution is just one sentence. Solution: In the returned action, make the following changes to the str string. OK! Str = new String (str. getBytes ("iso-8859-1"), "UTF-8"); analysis: knows its natural, know its natural: The information submitted from the browser is committed in bytes of the server, Server Resolution, finally, it is converted to the corresponding information. It is parsed into bytes. When it is parsed back, it will be parsed using the server's corresponding encoding. (Tomcat seems to be a ISO-8859-1 encoding by default) so you have to generate a new set of character you want, that is, declared as: UTF-8; the default encoding and requirement encoding vary according to different "requirements" and "containers!