javaWEB开发中get方式请求的乱码问题解决

我们在日常的开发中难免会遇到一些乱码问题的解决 

这个能解决一般get方式乱码问题

 

public String getStr(String str) {
  try {
   if(str == null) str = "";
   String temp_p = str;
   byte[] temp_t = temp_p.getBytes("ISO8859-1");
   String temp = new String(temp_t);
   return temp;
  }
  catch (Exception e) {
   e.printStackTrace();
  }
  return "";
 }

你可能感兴趣的:(get乱码)