java URL中文亂碼

若是URL中文參數亂碼的話,能夠嘗試:java

方法1:(java) 第一個頁面code

拼接URL 參數的時候用:URLEncoder.encode(參數, "UTF-8")ip

第二個頁面從request中獲取該參數utf-8

值 =new String(request.getParameter(參數名).getBytes("iso-8859-1"),"utf-8"); shopName = URLDecoder.decode(值,"UTF-8");get

方法2 (JavaScript)後臺

直接使用encodeURI(中文)亂碼

而後後臺直接獲取便可request

相關文章
相關標籤/搜索