代码拉取完成,页面将自动刷新
同步操作将从 Binary Wang/java-emoji-converter 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Emoji转换工具,便于各种规格客户端生成的Emoji字符串转换成另外一种格式。 A tool to convert emoji string among each type, like softbank emoji, unicode emoji, alias emoji, html emoji.
When converting softbank emoji to unicode, we utilize this file: https://raw.githubusercontent.com/googlei18n/emoji4unicode/master/data/emoji4unicode.xml
Add this in your maven pom file(将以下内容加入你的maven的pom文件中):
<dependency>
<groupId>com.github.binarywang</groupId>
<artifactId>java-emoji-converter</artifactId>
<version>0.1.1</version>
</dependency>
private EmojiConverter emojiConverter = EmojiConverter.getInstance();
@Test
public void testToAlias() {
String str = " An 😃😀awesome 😃😃string with a few 😃😉emojis!";
String alias = this.emojiConverter.toAlias(str);
System.out.println(str);
System.out.println("EmojiConverterTest.testToAlias()=====>");
System.out.println(alias);
Assert.assertEquals(
":no_good: :ok_woman: :couple_with_heart:An :smiley::grinning:awesome :smiley::smiley:string with a few :smiley::wink:emojis!",
alias);
}
@Test
public void testToHtml() {
String str = " An 😀😃awesome 😃😃string with a few 😉😃emojis!";
String result = this.emojiConverter.toHtml(str);
System.out.println(str);
System.out.println("EmojiConverterTest.testToHtml()=====>");
System.out.println(result);
Assert.assertEquals(
"🙅 🙆 💑An 😀😃awesome 😃😃string with a few 😉😃emojis!",
result);
}
@Test
public void testToUnicode() {
String str = " :smiley: :grinning: :wink:";
String result = this.emojiConverter.toUnicode(str);
System.err.println(str);
System.err.println("EmojiConverterTest.testToUnicode()=====>");
System.err.println(result);
Assert.assertEquals("🙅 🙆 💑 😃 😀 😉", result);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。