1. 程式人生 > >Java開發中的亂碼解決

Java開發中的亂碼解決

//server端: Servlet的doPost()方法中 String codeFmt = "UTF-8"; request.setCharacterEncoding(codeFmt); String param1 = request.getParameter("param1"); String param2 = request.getParameter("param2"); param1 = URLDecoder.decode(param1, codeFmt); param2 = URLDecoder.decode(param2, codeFmt);