


When I was doing mobile development before, there was a function to post comments that needed to be implemented. Although this function is relatively simple to implement, when I tested it, I said that the bug that the emoji that comes with the phone failed to send always appeared. So today I will bring you the solution to this BUG
1. Change the database format in the background
Execute the sql statement to change the encoding format of the database to utf8mb4 storage format, this 4-byte The UTF-8 storage format is perfectly compatible with the previous 3-byte storage format, and can directly store emoji expressions. This is the most perfect solution.
2. Use base-64 encoding
For example, you can use base-encode to encode emoji expressions and then store them in UTF-8. Just decode them when you take them out, but I have not tried it.
3. Get rid of emoji expressions
Kill it violently, I guess the PM will not agree to do this
4. Front-end processing
It is to use a third-party plug-in to convert the input emoji into a span tag and assign it the corresponding class, find a lot of emoji and expression pictures, and when sending them to the background, they send span expressions, which can be stored in the background. The advantage of this is that the display will be the same on all devices and will not cause any problems. Ambiguity, of course, the disadvantage is that emoji expressions are being updated. It is possible that the emoji expression image library you find is incomplete, and some expressions cannot be displayed on the page. This requires regular maintenance.
Recommend a more useful plug-in library github.com/node-module…
How to use: First download the emoji plug-in
<link href="http://cdn.staticfile.org/emoji/0.2.2/emoji.css" rel="stylesheet" type="text/css" /> <script src="http://cdn.staticfile.org/emoji/0.2.2/emoji.js"></script>
Map these two code libraries. This plug-in does not need to rely on the jquery library at all
Connect It will be even simpler
var text = document.querySelector('emojiText'); cosnoel.log(jEmoji. unifiedToHTML(text.value))
If you use commenJS specification
$ npm install emoji var emoji = require('emoji'); console.log('
The above is the detailed content of How to solve the bug that emoji expressions cannot be sent on the front end. For more information, please follow other related articles on the PHP Chinese website!

1月26日消息,根据国外科技媒体emojipedia报道,苹果在今天发布的iOS17.4Beta1更新中,面向27个欧盟国家测试开放侧载、第三方应用商店等重大改进之外,还新增了多个Emoji表情符号。iOS17.4Beta1更新添加了包括凤凰、青柠、上下摇头的笑脸,一系列指明方向的人物表情符号,来自Unicode于2023年9月提出的Emoji15.1更新。附上完整Emoji如下:本次更新共计新增118个Emoji,包括6个全新Emoji,4个无性别区分的家庭Emoji。此外还有6个现有人物表情

Golang(Go编程语言)是一种基于C语言的编程语言,被广泛用于Web开发、网络编程、操作系统等领域。然而,在编写Golang程序时经常会遇到一个常见的问题,就是“undeclaredname”(未声明名称)错误。下面将介绍如何解决这个问题。了解错误信息在编译和运行Golang程序时,如果遇到了未声明名称错误,会在控制台输出相应的错误信

Java中的ClassNotFoundException是一种常见的编译错误。当我们尝试使用Java虚拟机(JVM)加载某个类时,如果JVM找不到该类,就会抛出ClassNotFoundException。这个错误可能出现在程序运行时,也可能出现在编译时。在本文中,我们将讨论什么是ClassNotFoundException,它为什么会发生以及如何解决它。C

Go语言是一门越来越受欢迎的编程语言,它的简洁、高效、易于编写的特点已经被越来越多的开发者所认可。而在Go语言开发中,遇到编译错误是不可避免的。其中一个常见的错误就是“undefined:json.Marshal”。这个错误通常发生在你使用了Go标准库的“encoding/json”包时,编译器提示找不到“json.Marshal”的定义。这个问题的根本原

随着Java的广泛应用,Java程序在连接数据库时经常会出现JDBC错误。JDBC(JavaDatabaseConnectivity)是Java中用于连接数据库的编程接口,因此,JDBC错误是在Java程序与数据库交互时遇到的一种错误。下面将介绍一些最常见的JDBC错误及如何解决和避免它们。ClassNotFoundException这是最常见的JDBC

emoji表情作为Win10教育版最新添加的输入法功能,很多可爱的表情让聊天不在枯燥,但是有的用户在使用快捷键的时候会弹出该界面,今天小编为大家带来Win10教育版关闭emoji方法介绍。Win10教育版怎么关闭emoji1、首先需要右击下方任务栏右侧的输入法。2、在弹出的选项框中选择设置,进入语言设置界面。3、选择界面中的“按键”选项并滚动到最底端,能够找到“打开表情及符号面板”,这里可以关闭emoji表情。4、如果还安装了其他输入法的话,可以从Windows设置进入“设置和语言”界面,随后选

Go语言作为一门快速发展的编程语言,被广泛应用于各种项目和领域。然而,在使用golang编写程序时,你有可能会遇到一些报错,其中一个常见的报错是“undefinedvariableorfunction”。那么,这个错误是什么意思?它是如何产生的?又该如何解决呢?本文将会对这些问题进行探讨。首先,我们需要了解一些基本概念。在golang中,变量和函数是两

在Vue应用中遇到“SyntaxError:Unexpectedtoken”怎么解决?Vue是前端开发中广泛使用的一个JavaScript框架,它可以让我们更轻松地管理页面的状态、渲染和交互。但是在编写Vue应用时,有时会遇到“SyntaxError:Unexpectedtoken”报错,这个错误提示意味着代码中存在语法错误,JavaScript引擎


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download
The most popular open source editor
