The encoding of the JSP page is the encoding of the GBKoracle database is zhs16GBK (should also be GBK encoding) first is map.get ("username"). TOSTRING (), here returned to UserName, which should be encoded with GBK, but in transcoding After the cookie is stored (Tomcat should be deposited by the value of the cookie by default), the cookie read the cookie value "" or "??", the code is removed and coded in the following // database Enter cookiestring un = new string ("username"). ToString (). GetBytes ("GBK"), "ISO-8859-1"); // Transcoding String Uname = Util.Cookieutils.getCookieValue ("Username", request); uname = new string (uname.getbytes ("ISO-8859-1"), "GBK") Out.print (uname);