Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/binarywang/java-emoji-converter
Emoji转换工具,便于各种类型的客户端生成的Emoji字符串转换成另外一种格式
https://github.com/binarywang/java-emoji-converter
alias-emoji emoji html-emoji java java-emoji-converter softbank-emoji unicode-emoji
Last synced: 1 day ago
JSON representation
Emoji转换工具,便于各种类型的客户端生成的Emoji字符串转换成另外一种格式
- Host: GitHub
- URL: https://github.com/binarywang/java-emoji-converter
- Owner: binarywang
- Created: 2016-05-09T07:04:53.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-11-01T06:57:38.000Z (about 1 year ago)
- Last Synced: 2024-04-14T00:59:04.949Z (7 months ago)
- Topics: alias-emoji, emoji, html-emoji, java, java-emoji-converter, softbank-emoji, unicode-emoji
- Language: Java
- Homepage:
- Size: 138 KB
- Stars: 286
- Watchers: 20
- Forks: 75
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
[![码云Gitee](https://gitee.com/binary/java-emoji-converter/badge/star.svg?theme=blue)](https://gitee.com/binary/java-emoji-converter)
[![Github](https://githubbadges.com/star.svg?user=binarywang&repo=java-emoji-converter&style=flat&background=1081C1)](https://github.com/binarywang/java-emoji-converter)
[![Build Status](https://travis-ci.org/binarywang/java-emoji-converter.svg?branch=master)](https://travis-ci.org/binarywang/java-emoji-converter)
[![codecov](https://codecov.io/gh/binarywang/java-emoji-converter/branch/master/graph/badge.svg)](https://codecov.io/gh/binarywang/java-emoji-converter)
![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/java-emoji-converter.svg)# Java Emoji Converter(Emoji 表情转换工具)
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## Quick Start 快速入门
Add this in your maven pom file(将以下内容加入你的maven的pom文件中):
```xmlcom.github.binarywang
java-emoji-converter
1.0.2```
## Usage (from junit test):用法(摘自单元测试代码)
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);
}