emoji

How to match a URL containing emojis using a regex?

我们两清 提交于 2019-12-01 01:50:18
How can I write a regular expression to match URLs that contain emojis? The regex should match ordinary alphanumeric URLs along with URLs containing emojis in the domain name, path and/or parameters such as: http://🏹.to http://www .🏹.to/🚀🌖 http://🏹.to/I❤️coding?ref=🏹 Most web applications today (including, but not limited to, social networks, online communities, etc.) detect automatically URLs posted by the users as text and convert them into hyperlinks. Nonetheless, almost none of them (StackOverflow included) properly matches URLs that include emojis such as the examples reported above,

贴吧emoji表情导入微信

天大地大妈咪最大 提交于 2019-12-01 00:35:46
555555,有个人就是不告诉我怎么导进来,气的我只好自己疯狂百度,发现这个方法原来是通用的,就是做图有点点麻烦。注意如果什么操作都不做,直接从贴吧把表情拷贝过来,你会发现表情很模糊,并且可能有白底,看起来超丑!所以一定要操作一下,最后效果如下: 那么怎么弄呢,目前有两种方法,如果你图方便可以直接用第一种方法: 方法一 链接: https://pan.baidu.com/s/1v4kqajXZmaUOFlMh4D2GBw 密码:94vh 里面是已经制作好了优良的贴吧emoji图片,用电脑下载下来然后把所有图片直接给手机发就OK,呈现出来的就是上述图里一样的效果,因为这个制作得比较好,所以不会产生带白底的情况。但这个毕竟素材有限,如果你想获得新的emoji还是得看第二种方法。 方法二 方法二属于通用方法,适用于任何表情,具体可以分为以下几个步骤: step 1: 在贴吧里先将你想要的表情在任意一个帖子下面回复,然后在 网页版 贴吧中将这些表情另存为图片 (可能看起来会模糊但其实最后并不会)。 step 2: 把这些图片发送到手机端,并依次存储到相册中(记得下载原图),你会发现这些图就是我说的带白底的,超丑。 step 3: 在微信对话框先点下图所示的+号,然后在新界面疯狂往下拉,拉到最下面又有一个+号,再点进去就进入到我的相册里面了,然后选中你要保存的图,依次类推。

Using collections.Counter to count emojis with different colors

懵懂的女人 提交于 2019-11-30 23:02:15
I would like to use the collections.Counter class to count emojis in a string. It generally works fine, however, when I introduce colored emojis the color component of the emoji is separated from the emoji like so: >>> import collections >>> emoji_string = "👌🏻👌🏼👌🏽👌🏾👌🏿" >>> emoji_counter = collections.Counter(emoji_string) >>> emoji_counter.most_common() [('👌', 5), ('🏻', 1), ('🏼', 1), ('🏽', 1), ('🏾', 1), ('🏿', 1)] How can I make the most_common() function return something like this instead: [('👌🏻', 1), ('👌🏼', 1), ('👌🏽', 1), ('👌🏾', 1), ('👌🏿', 1)] I'm using Python 3.6 You'll have to split your

mysql/Java服务端对emoji或者生僻字的支持

。_饼干妹妹 提交于 2019-11-30 22:19:59
最近开发的iOS项目因为需要用户文本的存储,自然就遇到了emoji等表情符号如何被mysql DB支持的问题。困扰了数日,在就要绝望放弃的边缘,终于完成了转换和迁移。在此特别分析和整理,方便更多人。 问题描述: 如果UTF8字符集且是Java服务器的话,当存储含有emoji表情时,会抛出类似如下异常: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\x94' for column 'name' at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) at com.mysql.jdbc.ConnectionImpl.execSQL

修改MySQL字符集为utf8mb4,支持emoji表情

◇◆丶佛笑我妖孽 提交于 2019-11-30 22:19:43
一.将MySQL配置文件修改如下,没有的就添加 [client] port=3306 default-character-set = utf8mb4 [mysqld] character-set-client-handshake = FALSE character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci init_connect='SET NAMES utf8mb4' port=3306 basedir=D:\mysql #解压目录 datadir=D:\mysql\data #解压目录下data目录 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES [WinMySQLAdmin] D:\mysql\bin\mysqld.exe [mysql] default-character-set=utf8mb4 二.修改数据库和表字符集 修改数据库字符集: ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; 修改表的字符集: ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4

MySQL 解决 emoji表情 的方法,使用utf8mb4 字符集(4字节 UTF-8 Unicode 编码)

北城以北 提交于 2019-11-30 22:04:35
一、基本原则 如果要实现存储 emoji 表情到 MySQL 实例,需要应用客户端、到 MySQL 实例的连接、MySQL 实例内部 3 个方面统一使用或者支持 utf8mb4 字符集。 注:关于 utf8mb4 字符集,请参考 utf8mb4 字符集(4字节 UTF-8 Unicode 编码) 二、三个条件的说明 1、应用客户端 客户端需要保证输出的字符串的字符集为 utf8mb4。 注:utf8mb4只是MySQL中的概念,因为MySQL的UTF-8并不是真正意义上的UTF-8,我们的应用中只要使用UTF-8就可以了。 2、应用到 RDS MySQL 实例的连接 以常见的 JDBC 连接为例: 对于 JDBC 连接,需要使用 MySQL Connector/J 5.1.13(含)以上的版本。 JDBC 的连接串中,不配置 characterEncoding 选项。连接器会自动匹配识别字符集。 注:关于 MySQL Connector/J 5.1.13,请参考 MySQL 官方 Release Notes 比如 url=jdbc:mysql://localhost:3306/db_name?useUnicode=true&zeroDateTimeBehavior=convertToNull 3、MySQL 实例配置 3.1、修改my.cnf配置文件 这里使用VI来修改,输入命令

mysql支持emoji表情

Deadly 提交于 2019-11-30 22:04:21
最近开发的iOS项目因为需要用户文本的存储,自然就遇到了emoji等表情符号如何被mysql DB支持的问题。困扰了数日,在就要绝望放弃的边缘,终于完成了转换和迁移。在此特别分析和整理,方便更多人。 问题描述: 如果UTF8字符集且是Java服务器的话,当存储含有emoji表情时,会抛出类似如下异常: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x92\x94' for column 'name' at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) at com.mysql.jdbc.ConnectionImpl.execSQL

mysql utf8mb4字符集,存储emoji表情

折月煮酒 提交于 2019-11-30 22:04:12
字符集utf8mb4 utf8mb4兼容utf8,且比utf8能表示更多的字符。 看unicode编码区 从1 ~ 126就属于传统utf8区,当然utf8mb4也兼容这个区,126行以下就是utf8mb4扩充区,什么时候你需要存储那些字符,你才用utf8mb4,否则只是浪费空间。 官方地址:http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html MySQL 要存储emoji表情,因此发现我们常用的utf8 字符集根本无法存储表情。 首先将我们 数据库 默认字符集由utf8 更改为utf8mb4,对应的表默认字符集也更改为utf8mb4 已经存储表情的字段默认字符集也做了相应的调整。 SQL 语句 # 修改数据库: ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; # 修改表: ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; # 修改表字段: ALTER TABLE table_name MODIFY COLUMN column_name VARCHAR(191)

Some emojis (e.g. ☁) have two unicode, u'\u2601' and u'\u2601\ufe0f'. What does u'\ufe0f' mean? Is it the same if I delete it?

人走茶凉 提交于 2019-11-30 21:50:11
问题 I'm writing a python program to judge emoji with a collected emoji unicode set. During the test, I found that one emoji,take ☁ as an example, has two unicode, u'\u2601' and u'\u2601\ufe0f' , what does \ufe0f mean? Is it the same if I delete it? 回答1: That's the Variant Form, which provides more information for those displays, that are capable of displaying with colour and other things. This chart gives you the difference between FE0F and FE0E : You could consider that the FE0E version is the

Send unicode emoji with PHPMailer

老子叫甜甜 提交于 2019-11-30 21:38:23
I'm trying to send unicode emoji trough PHPMailer (5.2) but the emails I sent are received with weird characters instead of emojis. I'm currently sending HTML emails where I just echo a string containing some utf-8 emoji and inspecting the email source the string seems to be printed correctly. For example: echo "😁"; produces: =F0=9F=98=81 in the email source code (which should be OK). drakyoko It turns out that PHPMailer uses charset=iso-8859-1 by default in HTML emails (in the email header you'll find Content-Type: text/html; charset=iso-8859-1 while you should use UTF-8: Content-Type: text