Home > Java > javaTutorial > How to implement Springboot's support for Emoji expressions

How to implement Springboot's support for Emoji expressions

王林
Release: 2023-05-12 11:16:05
forward
1741 people have browsed it

Effect display diagram:

Pass parameters

How to implement Springboots support for Emoji expressions

Conversion storage:

How to implement Springboots support for Emoji expressions

Parse return page display:

How to implement Springboots support for Emoji expressions

Start

1. Add dependencies to pom.xml:

<dependency>
            <groupId>com.vdurmont</groupId>
            <artifactId>emoji-java</artifactId>
            <version>4.0.0</version>
        </dependency>
Copy after login

2. Before receiving parameters and storing them, Convert:

EmojiParser.parseToAliases(xxxxemoji表情参xxx)
Copy after login

How to implement Springboots support for Emoji expressions

##Test example:

System.out.println(EmojiParser.parseToAliases("uD83DuDE0EuD83DuDE02uD83EuDD37uD83DuDCAAuD83DuDC7D"));

How to implement Springboots support for Emoji expressions

# PS: Some people may have questions after reading this. If the parameter value is not to save emoji expressions, can it still be successful?

The best way to eliminate doubts is to take action:


How to implement Springboots support for Emoji expressions

3. The converted data has been stored, so in the end you only need to obtain Just convert it back when it comes out:

EmojiParser.parseToUnicode(xxxx转化后的emoji值xxxx)
Copy after login

How to implement Springboots support for Emoji expressions

##System.out.println(EmojiParser.parseToUnicode(":sunglasses::joy::shrug::muscle: :alien:"));

The above is the detailed content of How to implement Springboot's support for Emoji expressions. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template