I tried follows in test.do: String name=request.getParameter("Name"); System.out.println(new String(name.getBytes("UTF-8"), "gb2312")) it still show [EMAIL PROTECTED],Why?
On 5/8/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Red, red phoenix wrote: > If I input English name in the field Name in JSP,when I submit,the > test.do will receive right English name,but when I input Chinese name > in the field Name in JSP, test.do will receive not right name,it will > show [EMAIL PROTECTED] This is what you get when you print out a byte array. Try converting the byte array to a String using "new String(bytes, charset)" and printing that. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGQJwZ9CaO5/Lv0PARAmyvAJ9aCJZ/MINdBzS18ytQMgzf4M8D3ACffHSG Ldprq3v5ZTLxYF80HoafTOY= =vx7I -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]