例子:
String name = new String(username.getBytes("ISO-8859-1"),"UTF-8");
用到我的程序中也一样,我用的
String param1 =request.getParameter("category");
String category =new String(param1 .getBytes("GBK"),"UTF-8"); // 商品类别
或者用过滤器
https://blog.csdn.net/yyw6637/article/details/8786596