我正在尝试在聊天应用程序中呈现表情符号,但在获得由多个部分构成的表情符号时遇到了问题。
例如:
Person with Ball的代码点26f9可以正常工作
const emoji = String.fromCodePoint('0x26f9');但用于Woman bouncing ball的26f9-fe0f-200d-2640-fe0f不起作用
const emoji = String.fromCodePoint('0x26f9-fe0f-200d-2640-fe0f');发布于 2020-08-18 01:56:58
弄清楚了:
const codePointString = '26f9-fe0f-200d-2640-fe0f';
const emoji = codePointString.split('-').map((codePoint) => (
String.fromCodePoint(`0x${codePoint}`)
)).join('');https://stackoverflow.com/questions/63456170
复制相似问题