utf-8 特殊字符过滤
来源:互联网 发布:直营店监控软件mac 编辑:程序博客网 时间:2024/05/22 00:41
/**
* 去除字符串特殊字符
* */
public static String stripNonCharCodepoints(String input) {
if (input != null) {
input = input.replace("", "");
}
StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < input.length(); i++) {
ch = input.charAt(i);
if (ch % 0x10000 != 0xffff && // 0xffff - 0x10ffff range step 0x10000
ch % 0x10000 != 0xfffe && // 0xfffe - 0x10fffe range
(ch <= 0xfdd0 || ch >= 0xfdef) && // 0xfdd0 - 0xfdef
(ch > 0x1F || ch == 0x9 || ch == 0xa || ch == 0xd)) {
retval.append(ch);
}
}
return retval.toString();
}
* 去除字符串特殊字符
* */
public static String stripNonCharCodepoints(String input) {
if (input != null) {
input = input.replace("", "");
}
StringBuilder retval = new StringBuilder();
char ch;
for (int i = 0; i < input.length(); i++) {
ch = input.charAt(i);
if (ch % 0x10000 != 0xffff && // 0xffff - 0x10ffff range step 0x10000
ch % 0x10000 != 0xfffe && // 0xfffe - 0x10fffe range
(ch <= 0xfdd0 || ch >= 0xfdef) && // 0xfdd0 - 0xfdef
(ch > 0x1F || ch == 0x9 || ch == 0xa || ch == 0xd)) {
retval.append(ch);
}
}
return retval.toString();
}
0 0
- utf-8 特殊字符过滤
- ASP特殊字符过滤
- ASP特殊字符过滤
- ASP过滤特殊字符
- 过滤特殊字符
- 过滤特殊字符
- C++ 过滤特殊字符
- 过滤sql特殊字符
- php特殊字符过滤
- php特殊字符过滤
- java过滤特殊字符
- js过滤特殊字符
- 特殊字符过滤
- java 过滤特殊字符
- 过滤特殊字符
- 过滤特殊字符
- java 过滤特殊字符
- js过滤特殊字符
- 2014-09-17 分歧者
- 1.最简单开始
- 使用 Unity Application Block(三):理解和使用依赖注入的键
- win7下安装配置totoro
- SVN服务器搭建和使用(二)
- utf-8 特殊字符过滤
- Android 开源框架Universal-Image-Loader完全解析(一)--- 基本介绍及使用
- 还有一些你不知道的IT之事
- debian系统配置ip地址
- 使用 Spring Security 保护 Web 应用的安全
- 学习笔记:shell 下 符号 [`],[""], [''], [$] 用法
- context理解
- 我碌碌无为的研究生生活
- OSE Real-Time Kernel