//数据库中无法保存表情符号,需要强行去除
String removeEmoji(String alias){
String source=new String (alias);
while(true) {
Integer pos = source.indexOf("\uD83D");
if(pos == -1) {
pos = source.indexOf("\uD83C");
}
if(pos != -1) {
source = source.substring(0, pos) + source.substring(pos +2);
}else{
break;
}
}
logger.warn(String.format("微信名%s去除特殊符号以后为%s", alias,source));
return source;
}