如何将不协调的服务器名称转换为“普通文本”?

3htmauhk  于 2021-09-13  发布在  Java
关注(0)|答案(0)|浏览(132)

discord允许用户和服务器使用unicode、emojis等基本上任何名称。我不需要解决方案来修复所有名称,但我需要“规范化”尽可能多的unicode。我在这里尝试过解决方案,但由于某种原因,unicode根本没有被转换。这就是我现在拥有的。我需要一些类似的东西𝘽𝙖𝙠𝙖 𝙂𝙖𝙣𝙜' 成为“巴卡帮”

function unicodeToChar(unicode) {

        const arr = [];

        for (const char of unicode) {
            arr.push(char);
        }

        const newWord = [];

        arr.forEach(letter => newWord.push(String.fromCharCode(parseInt(letter))));

        return newWord.join('');
    }

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题