• Stars
    star
    286
  • Rank 144,690 (Top 3 %)
  • Language
    Java
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Emoji转换工具,便于各种类型的客户端生成的Emoji字符串转换成另外一种格式

码云Gitee Github Build Status codecov Maven Central

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文件中):

<dependency>
  <groupId>com.github.binarywang</groupId>
  <artifactId>java-emoji-converter</artifactId>
  <version>1.0.2</version>
</dependency>

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(
        "&#128581; &#128582; &#128145;An &#128512;&#128515;awesome &#128515;&#128515;string with a few &#128521;&#128515;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);
}

More Repositories

1

weixin-java-mp-demo

基于Spring Boot 和 WxJava 实现的微信公众号Java后端Demo,支持多公众号
Java
1,726
star
2

weixin-java-miniapp-demo

基于Spring Boot 和 WxJava 实现的微信小程序Java后端Demo
Java
1,153
star
3

weixin-java-pay-demo

基于Spring Boot 和 WxJava 实现的微信支付Java后端Demo
Java
822
star
4

java-testdata-generator

使用Java实现的各种测试数据的随机生成工具,包括身份证号码,银行卡号,姓名,手机号等
Java
563
star
5

weixin-java-cp-demo

基于Spring Boot 和 WxJava 实现的微信企业号/企业微信 后端Demo
Java
300
star
6

weixin-java-mp-demo-springmvc

基于Spring MVC 和 WxJava 实现的微信公众号Java后端Demo
Java
295
star
7

weixin-java-mp-multi-demo

微信公众号demo,基于WxJava 和 Spring MVC框架实现,支持多公众号
Java
102
star
8

qrcode-utils

二维码生成工具
Java
91
star
9

wx-java-mp-demo

使用wx-java-mp-spring-boot-starter开发的微信公众号演示demo
Java
40
star
10

wx-java-pay-demo

使用wx-java-pay-spring-boot-starter开发的微信支付演示demo
Java
16
star
11

wx-java-miniapp-demo

使用wx-java-miniapp-spring-boot-starter开发的微信小程序演示demo
Java
13
star
12

WxJava-for-JDK6

微信开发 Java SDK for JDK6,停止更新,请参考主程序
Java
12
star
13

binarywang

10
star
14

jar-utils

用于批量替换jar包中文件或字符串的工具类
Java
8
star
15

weixin-java-mp-javadoc

weixin-java-mp的javadoc
HTML
8
star
16

yaml-utils

yaml工具,用于提取、增加或替换指定文件指定属性的值
Java
6
star
17

weixin-java-pay-javadoc

微信支付weixin-java-pay的javadoc
HTML
6
star
18

weixin-java-miniapp-javadoc

HTML
4
star
19

weixin-java-common-javadoc

weixin-java-common的javadoc
HTML
3
star
20

jmeter-bsh-utils

Jmeter utils for beanshell script
Java
2
star
21

camel-test

Java
2
star
22

weixin-java-cp-javadoc

weixin-java-cp的javadoc
HTML
2
star
23

jmh-test

Java
1
star
24

java-test

Java
1
star
25

drools-test

Java
1
star
26

weixin-java-open-javadoc

weixin-java-open的javadoc
HTML
1
star
27

speedment-test

Java
1
star