String[] codes = { "iso-8859-1", "utf-8", "gbk", "unicode" }; for (int i = 0; i < codes.length; i++) { for (int j = 0; j < codes.length; j++) { String code1 = codes[i]; String code2 = codes[j]; String changVal = new String(req.getParameter("Columns").getBytes(code1), code2); System.out.println("转换前后编码[" + code1 + ", " + code2 + "]=======" + changVal); } }