一、提交中文是使用javascript的函數:encodeURIComponent()進行編碼,
例如:
String
param=encodeURIComponet("param");
然后到服務器端使用UTF-8編碼提取參數:
request.setCharacterEncoding("UTF-8");
String str = request.getParameter("param");
然后使用下面的方式進行解碼:
java.net.URLDecoder.decode(str,"UTF-8")
這樣就可以得到正確的參數。
posted on 2007-09-20 12:22
kelly 閱讀(1477)
評論(0) 編輯 收藏 所屬分類:
java