index.jsp页面:
<body>
<% String id = "陈"; %>
<a href="test?id=<%=URLEncoder.encode(id,"UTF-8") %>">点击</a>
</body>
servlet页面(test.java):
String id = request.getParameter("id");
System.out.println(id);
id= new String(id.getBytes("ISO-8859-1"), "UTF-8");
id = URLDecoder.decode(id,"UTF-8");
System.out.println(id);
控制台看图: