Function: handleEmoji

handleEmoji(str?, type?): string

处理emoji,用于把用utf16编码的字符转换成实体字符

Parameters

Name Type Default value Description
str string '' 需要编译/解析的字符串
type "encode" | "decode" 'encode' encode 编译 decode 转义

Returns

string

编译/解析后的字符串

Example

handleEmoji("😃", "encode");
// => "😃"
handleEmoji("😊", "decode");
// => "😊"
ON THIS PAGE