java乱码

 String ddf = request.getParameter(tiankongnumIDS[i]+"_tiankongnum");
			 System.out.println("------>" + ddf); 
			 String temp = "";
			try {
				temp = new String(ddf.getBytes("ISO-8859-1") , "GB2312");

				System.out.println("---GB2312--->" + temp);

				temp = new String(ddf.getBytes("ISO-8859-1") , "GBK");

				System.out.println("----GBK-->" + temp);

				temp = new String(ddf.getBytes("ISO-8859-1") , "utf-8");

				System.out.println("----utf-8-->" + temp);

				temp = new String(ddf.getBytes("GBK") , "utf-8");

				System.out.println("----utf-->" + temp);
				
				temp = new String(ddf.getBytes("GBK") , "GB2312");

				System.out.println("----GB2312-->" + temp);

你可能感兴趣的:(java)