public String filter(String str) {
str = str.replaceAll("&", "&");
str = str.replaceAll("<", "<");
str = str.replaceAll(">", ">");
str = str.replaceAll(" ", " ");
str = str.replaceAll("'", "'");
str = str.replaceAll("\"", """);
str = str.replaceAll("\n", "<br>");
try {
str = new String(str.getBytes("ISO-8859-1"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return str;
}
汉字的乱码,与字符的过滤
最新推荐文章于 2022-10-17 17:56:25 发布