emoji

Emoji symbols/emoticons in Python IDLE

余生颓废 提交于 2019-12-11 07:49:55
问题 I can't encode and display characters in the range \U0001f600-\U0001f650. They are called emoji or emoticons and they are used in all social media. Python error message: File "C:\Python\Python342x64\lib\encodings\cp1251.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f62d' in position 108: character maps to <undefined> This character must look like - 😭 . I work in Python 3.4.2 (from

Filtering empty strings from a string containing emojis using spread syntax

有些话、适合烂在心里 提交于 2019-12-11 06:34:46
问题 I'm trying to stay hip, so I've been playing with the spread operator and emojis. I noticed that when I want to filter empty strings ( '' ) out the resulting "spread-ed" array, the empty strings are not being removed. Why is that? console.log([...'😀︎']); // ['😀︎', ''] console.log([...'😀︎'].filter(String)); // ['😀︎', ''] console.log(['😀︎', ''].filter(String)); // ['😀︎'] 回答1: There is in your string an invisible character, which is a variation selector. You can see this if you print the

How to extract emojis and flags from strings in Python?

久未见 提交于 2019-12-11 04:47:39
问题 import emoji def emoji_lis(string): _entities = [] for pos,c in enumerate(string): if c in emoji.UNICODE_EMOJI: print("Matched!!", c ,c.encode('ascii',"backslashreplace")) _entities.append({ "location":pos, "emoji": c }) return _entities emoji_lis("👧🏿 مدیحہ🇵🇰 así, se 😌 ds 💕👭") Matched!! 👧 \U0001f467 Matched!! 🏿 \U0001f3ff Matched!! 😌 \U0001f60c Matched!! 💕 \U0001f495 Matched!! 👭 \U0001f46d My code is working of all other emoji's but how can I detect country flags 🇵🇰? 回答1: Here is an article

emoji display as ? in MySQL database

和自甴很熟 提交于 2019-12-11 03:56:53
问题 Emoji are stored as ? in my database (when i'm visualizing them using phpMyAdmin), however when i retrieve them using a simple request (from php) i get the real value. line on database (using phpMyAdmin) Request from php $query = "SELECT id,com FROM coms_table WHERE id = 627"; Result id com 627 \ud83d\ude0e Using this command mysql> SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'; i get this : my.cnf file : [client] default-character-set=utf8mb4

Counter for words and emoji

心不动则不痛 提交于 2019-12-11 02:13:09
问题 I have a dataframe with a column "clear_message", and I created a column that counts all the words in each row. history['word_count'] = history.clear_message.apply(lambda x: Counter(x.split(' '))) For example, if the rows message is: Hello my name is Hello Then the counter in his row, will be Counter({'Hello': 2, 'is': 1, 'my': 1, 'name': 1}) The problem I have emoji in my text, and I want also a counter for the emoji. For example: test = '👹👹👹👹👹here sasdsa' test_counter = Counter(test.split('

how to limit max characters in edittext with emoji inputs allowed?

天涯浪子 提交于 2019-12-11 02:03:17
问题 I have a requirement where I need to limit the number of characters entered in EditText. I know this can be easily achieved with the attribute android:maxLength for my EditText in my .xml layout file. But my problem is my EditText should also allow users to enter emojis. Now the catch is, the length of some of the emojis is sometimes 2 or sometimes 1. So, android:maxLength=1 doesn't allow entering emojis with length = 2. I can get the correct length of a string (with each emoji character

Emoji to Hex value in ios

南笙酒味 提交于 2019-12-10 22:32:50
问题 I want to know how to convert the emoji to hex value.That is for the smiley having 'SMILING FACE WITH OPEN MOUTH AND SMILING EYES' ( smiley corresponds to :) ) I should get "1F604" 回答1: Is this what you are looking for? NSString *smiley = @"😄"; NSData *data = [smiley dataUsingEncoding:NSUTF32LittleEndianStringEncoding]; uint32_t unicode; [data getBytes:&unicode length:sizeof(unicode)]; NSLog(@"%x", unicode); // Output: 1f604 Reverse direction: uint32_t unicode = 0x1f604; NSString *smiley = [

Searching emoji from varchar column returns different record

好久不见. 提交于 2019-12-10 22:32:22
问题 I'm using MySQL5.6. The DB character set is utf8mb4. When I search emoji as below, I got unexpected results. mysql> SELECT id, hex(title) FROM tags WHERE title = 0xF09F9886; +-----+------------+ | id | hex(title) | +-----+------------+ | 165 | F09F9886 | | 166 | F09F9884 | +-----+------------+ It should return only id=165. Does anyone know this why? 回答1: I found how to fix it. It was a problem of collation. I used default collation value, I presume it's utf8mb4_general_ci . When I changed

Explain why Chrome interprets Arial emojis differently than in any other font - it adds a gender symbol

☆樱花仙子☆ 提交于 2019-12-10 22:12:04
问题 Could someone explain why some emoji have the gender symbol added to them when using Chrome and an Arial font? Arial facepalm renders with gender symbol in Chrome chrome version: 63.0.3239.132 Here's the html <!DOCTYPE html> <html> <style> .emoji { font-family: Times; } </style> <body> <p style="font-family: Arial">Arial Facepalm with symbol 🤦‍♂️</p> <p style="font-family: Arial">Arial Facepalm without symbol 🤦‍️</p> <p class=emoji>Times Facepalm with symbol 🤦‍♂️‍</p> <p class=emoji>Times

Emoji on Android Notification

我只是一个虾纸丫 提交于 2019-12-10 20:38:45
问题 I'm trying to display an emoji on notification bar. Here is my string: "\ue057 " + getString(R.string.notification_sent_hey) I've already tried using the softbank, and every format possible: "U+1F601", "\xF0\x9F\x98\x81" What should I do? Thanks. 回答1: You can't do it like that. Notifications have a layout, and you are forced to use that layout. A big icon, text, and a little icon. That's it. It's quite clearly stated here: http://developer.android.com/design/patterns/notifications.html So,