The Android client has a login registration program. when registering, enter the user name and password. the client uploads the form data to the Servlet in The GET mode, and then the Servlet uses Stringnamerequest. getParameter (& quot; username & quot;); Stringpasswordrequest. getParameter (& quot; password & quot;); obtain the user name and password, and then execute the SQL statement to insert the user name and password into MySql. this is the whole process, in addition, if the user name and password are composed of only numbers and letters, the client can normally send the mysqltomcat Android garbled code.
The Android client has a login registration program. when registering, enter the user name and password. the client uploads the form data to the Servlet in The GET mode, and then the Servlet uses String name = request. getParameter ("username"); String password = request. getParameter ("password"); get the user name and password, and then execute the SQL statement to insert the user name and password into MySql. this is the whole process, in addition, the user name and password can be added to the database normally only when they are composed of numbers and letters. The problem arises. when I input the user name as a Chinese character, it turns into a square when I insert it into the database, that is, garbled characters ??.. How can this problem be solved? I have searched the internet for a long time. This Post says that I set what to be GBK, that post says that I set what to be GB2312, and that post says that I set what to be UTF8, I am confused. how should I set it ??? I am a little white, and sometimes I don't understand the solutions written by those great gods... Helpless .. Now I want to know, it must be code like adding transcoding, right ??? Is transcoding received by the server when the client is sent and then transcoded before being inserted into the database ?? So what is the code... I only scored 5 points, so I took all of them out ..