emoji

【记录】mysql中建表utf8和utf8mb4区别?timestamp和datetime区别?

末鹿安然 提交于 2019-12-02 02:47:22
mysql中建表utf8和utf8mb4区别? 1:utf8 是 Mysql 中的一种字符集,只支持最长三个字节的 UTF-8字符,也就是 Unicode 中的基本多文本平面 2:要在 Mysql 中保存 4 字节长度的 UTF-8 字符,需要使用 utf8mb4 字符集,但只有 5.5.3 3:版本以后的才支持(查看版本: select version();)。我觉得,为了获取更好的兼容性,应该总是使用 utf8mb4 而非 utf8. 4:对于 CHAR 类型数据,utf8mb4 会多消耗一些空间,根据 Mysql 官方建议,使用 VARCHAR 替代 CHAR。 为了获取更好的兼容性,应该总是使用 utf8mb4 而非 utf8,事实上,最新版的phpmyadmin默认字符集就是utf8mb4。诚然,对于 CHAR 类型数据,使用utf8mb4 存储会多消耗一些空间。 那么utf8mb4比utf8多了什么的呢? 多了emoji编码支持. 如果实际用途上来看,可以给要用到emoji的库或者说表,设置utf8mb4. 比如评论要支持emoji可以用到. 建议普通表使用utf8 如果这个表需要支持emoji就使用utf8mb4 timestamp和datetime区别? 1 区别 1.1 占用空间 类型 占据字节 表示形式 datetime 8 字节 yyyy-mm-dd hh

Emoji in R [UTF-8 encoding]

感情迁移 提交于 2019-12-02 02:24:32
I'm trying to make an emoji analysis on R. I have stored some tweets where there are emojis. Here is one of the tweet that I want to analyze : > tweetn2 [1] "Programme du week-end: \xed\xa0\xbd\xed\xb2\x83\xed\xa0\xbc \xed\xbe\xb6\xed\xa0\xbc \xed\xbd\xbb\xed\xa0\xbc\xed\xbd\xbb\xed\xa0\xbc \xed\xbd\xbb\xed\xa0\xbc\xed\xbd\xbb" To be sure that I have "UTF-8": > Encoding(tweetn2) [1] "UTF-8 " Now when I'm trying to recognize some characters, it's not working fine > grepl("\\xed",tweetn2) [1] FALSE or > grepl("xed",tweetn2) [1] FALSE But it seems that emojis "\xed\xa0\xbd" are not "UTF-8"

Questions about iPhone emoji and web pages

[亡魂溺海] 提交于 2019-12-02 02:09:07
问题  Okay, so emoji basically shows the above on a computer. Is that another programming language? So how do I put those little boxes into a php file? When I put it into a php file, it turns into question marks and what not. Also, how can I store these in a MySQL without it turning into question marks and other weird things? 回答1: how do I put those little boxes into a php file? Same way as any other Unicode character. Just paste them and make sure you're saving the PHP file and

Python unicode character conversion for Emoji

有些话、适合烂在心里 提交于 2019-12-02 00:57:02
问题 I'm having some issues with formatting a byte ordered mark to unicode. There is some oddness coming in with how my character is being expressed. Basically it's not printing an emoji character in Python, instead it's just the string. Here's my example. # these codes are coming from a json file; this a representation of one of the codes. e = 'U+1F600' # smile grin emoji # not sure how to clean this, so here's a basic attempt using regex. b = re.compile(r'U\+', re.DOTALL).sub('\U000', e) print

Questions about iPhone emoji and web pages

白昼怎懂夜的黑 提交于 2019-12-02 00:49:07
 Okay, so emoji basically shows the above on a computer. Is that another programming language? So how do I put those little boxes into a php file? When I put it into a php file, it turns into question marks and what not. Also, how can I store these in a MySQL without it turning into question marks and other weird things? how do I put those little boxes into a php file? Same way as any other Unicode character. Just paste them and make sure you're saving the PHP file and serving the PHP page as UTF-8. When I put it into a php file, it turns into question marks and what not Then

Python emoji search and replace not working as expected

落花浮王杯 提交于 2019-12-02 00:48:01
I am trying to separate emoji in given text from other characters/words/emojis. I want to use emoji later as features in text classification. So it is important that I treat each emoji in the sentence individually and as a separate character. The code: import re text = "I am very #happy man but😘😘 my wife😞 is not 😊😘" print(text) #line a reg = re.compile(u'[' u'\U0001F300-\U0001F64F' u'\U0001F680-\U0001F6FF' u'\u2600-\u26FF\u2700-\u27BF]+', re.UNICODE) #padding the emoji with space at both the ends new_text = reg.sub(' \1 ',text) print(new_text) #line b # this is just to test if it can still

Removing all Emojis from Text

穿精又带淫゛_ 提交于 2019-12-02 00:24:28
问题 This question has been asked here Python : How to remove all emojis Without a solution, I have as step towards the solution. But need help finishing it off. I went and got all the emoji hex code points from the emoji site: https://www.unicode.org/emoji/charts/emoji-ordering.txt I then read in the file like so: file = open('emoji-ordering.txt') temp = file.readline() final_list = [] while temp != '': #print(temp) if not temp[0] == '#' : utf_8_values = ((temp.split(';')[0]).rstrip()).split(' ')

Encode a high code point (> U+FFFF) to HTML entities

房东的猫 提交于 2019-12-01 21:55:12
I have an input string (URL-encoded): %F0%9F%98%8E which decoded is the emoji "😎". How can I convert this to the HTML-Code 😎 ? http://unicode.online-toolz.com/tools/unicode-html-entities-convertor.php this site is doing exactly what I need. Tim Groeneveld <?php function mb_ord($char, $encoding = 'UTF-8') { if ($encoding === 'UCS-4BE') { list(, $ord) = (strlen($char) === 4) ? @unpack('N', $char) : @unpack('n', $char); return $ord; } else { return mb_ord(mb_convert_encoding($char, 'UCS-4BE', $encoding), 'UCS-4BE'); } } function mb_htmlentities($string, $hex = false, $encoding = 'UTF-8') { return

Removing all Emojis from Text

守給你的承諾、 提交于 2019-12-01 20:48:09
This question has been asked here Python : How to remove all emojis Without a solution, I have as step towards the solution. But need help finishing it off. I went and got all the emoji hex code points from the emoji site: https://www.unicode.org/emoji/charts/emoji-ordering.txt I then read in the file like so: file = open('emoji-ordering.txt') temp = file.readline() final_list = [] while temp != '': #print(temp) if not temp[0] == '#' : utf_8_values = ((temp.split(';')[0]).rstrip()).split(' ') values = ["u\\"+(word[0]+((8 - len(word[2:]))*'0' + word[2:]).rstrip()) for word in utf_8_values]

jquery.emoji.js

喜夏-厌秋 提交于 2019-12-01 19:48:09
1、引用 <link rel="stylesheet" href="/static/css/jquery.mCustomScrollbar.css" /> <link rel="stylesheet" href="/static/plug/jQuery-moji/src/css/jquery.emoji.css"/> <script src="/static/js/jquery-3.4.1.js" type="text/javascript" charset="utf-8"></script> <script src="/static/js/jquery.mCustomScrollbar.js"></script> <script src="/static/plug/jQuery-emoji/lib/script/jquery.mousewheel-3.0.6.min.js"></script> <script src="/static/plug/jQuery-emoji/src/js/jquery.emoji.js"></script> 2、html <div class="windows_input" id="talkbox"> <div class="input_icon"> <a href="javascript:;"></a> </div> <div class=