EmojiUtils.java
745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package cn.com.glsx.entmicro.util;
import com.vdurmont.emoji.EmojiParser;
/**
* @author zhouhaibao
* @version 1.0
* @description: 表情包处理工具类
* @date 2021/12/4 11:24
*/
public class EmojiUtils {
/**
* 将表情包转字符串
*
* @param str
* @return
*/
public static String parseToHtmlHexadecimal(String str) {
if (str == null) {
return null;
}
return EmojiParser.parseToHtmlHexadecimal(str);
}
/**
* 字符串转表情
*
* @param str
* @return
*/
public static String parseToUnicode(String str) {
if (str == null) {
return null;
}
return EmojiParser.parseToUnicode(str);
}
}