emoji

How to replace emoji characters with their descriptions in a Swift string

北慕城南 提交于 2019-12-07 08:04:08
问题 I'm looking for a way to replace emoji characters with their description in a Swift string. Example: Input "This is my string 😄" I'd like to replace the 😄 to get: Output "This is my string {SMILING FACE WITH OPEN MOUTH AND SMILING EYES}" To date I'm using this code modified from the original code of this answer by MartinR, but it works only if I deal with a single character. let myCharacter : Character = "😄" let cfstr = NSMutableString(string: String(myCharacter)) as CFMutableString var range

Emoji Support for iOS and Android

南楼画角 提交于 2019-12-07 04:16:56
问题 I am trying to develop an application for both iOS and Android with emoji support in posts. Currently I am Base64 encoding and decoding the String (text &/ emoji) with UTF-8. It seems to work natively, Android-to-Android and iOS-to-iOS, but from Android -> iOS or iOS -> Android it doesn't always work. There are occasionally a few emojis missing, and the rest of the string (any actual text) is lost in these instances. Note: I understand different devices have different emojis, so I am not as

Show emoji on notification like Whatsapp

时光毁灭记忆、已成空白 提交于 2019-12-07 03:13:27
问题 I need to show some emojis on setContentText on NotificationCompat like Whatsapp shows. I have tried to use the softbank and some variations, nothing work. (see Emoji on Android Notification) Like Gabe Sechan suggested, probably the default font on NotificationCompat doesn't support emojis. Is there a way to change the default font on NotificationCompat ? If not, how does whatsapp shows emojis on its notifications? Thanks. 回答1: This is the only way I got it working: Spanned mssg; mssg = Html

Emoji's in mysql turns to question marks

北慕城南 提交于 2019-12-06 19:50:19
问题 I am trying to insert emoji's into mysql but it turns to question marks, I have changed mysql connection server collation, database collation , table collation and column collation. I used these to change the items # For each database: ALTER DATABASE database_name CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; # For each table: ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; # For each column: ALTER TABLE table_name CHANGE column_name column_name

Show Emoji Keyboard On Android?

☆樱花仙子☆ 提交于 2019-12-06 14:41:07
so I am building an Android app. I have used a custom emojicon pack that comes with emojis that look like the iOS ones. However, I've noticed that KitKat comes with native emoji support, so I want show that to users instead of my custom window if they have KitKat. How do I show a certain keyboard window, without changing the imeOptions? I tried mEditText.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_PICTSYMBOLS)) , but that didn't seem to do the trick put this properties in your edittext android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"

datax同步emoji表情到mysql报错

送分小仙女□ 提交于 2019-12-06 13:48:05
前期已经通过msyql客户端(黑窗口)修改了mysql的编码和字符集, mysql中已经可以插入emoji表情,但是通过数据同步(datax),从hive同步emoji表情到mysql报错: 解决方案: -- 修改mysql配置文件 vim /etc/my.cnf -- 添加如下内容 [client] default-character-set=utf8mb4 [mysql] default-character-set=utf8mb4 [mysqld] character-set-server=utf8mb4 collation-server=utf8mb4_unicode_ci init_connect='SET NAMES utf8mb4' -- 重启mysqld systemctl restart mysqld.service -- 查看myqld运行状态,保证重启之后的mysql正常运行 service mysqld status -- 建库 CREATE DATABASE `xcdqm` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; -- 建表 CREATE TABLE `test_emoji` ( `id` int(11) DEFAULT NULL, `emoji` varchar(1000) COLLATE

How can I determine if a specific emoji character can be rendered by an iOS device?

本秂侑毒 提交于 2019-12-06 12:52:38
问题 With the release of iOS 9.1, we got a lot of cool new emoji like taco (🌮)! I'm working on an application where I'd like to show the new emoji characters on devices where they are supported but keep them hidden on devices where they are not. Is there a way to determine if a given emoji character (contained in an NSString) can be rendered on the device the app is running on? After quite a bit of digging on SO and experimenting I've come up with a solution which I will post as an answer below,

Add skin tone modifier to an emoji programmatically

拥有回忆 提交于 2019-12-06 12:35:54
问题 I am having some issues adding a skin tone modifier to an emoji in my app. For example, if I use: let text = "👍" + "🏻" It prints 👍🏻 However, for other emojis it does not work. For example: let text = "👩‍🦰" + "🏻" Prints 👩‍🦰🏻 What is the proper way to add a skin tone modifier to an emoji? 回答1: Adding the skin tone modifier only works if the preceding character is a plain Emoji character. It turns out, your "👩‍🦰" is actually made up of 3 characters. The plain woman emoji U+1F469 ( 👩 ), followed

How can I properly use two-character-width emoji in my bash prompt?

£可爱£侵袭症+ 提交于 2019-12-06 12:08:47
问题 I want to use an American flag emoji in my bash prompt (i.e. PS1 environment variable). However, the American flag emoji causes the terminal cursor to offset an extra character to the right. 🇺🇸 is comprised of two unicode characters, 🇺 and 🇸. I believe terminal is converting this to a mono-spaced emoji character (the flag), yet still allocating space for two characters. How can I achieve my expected cursor position? I want: 🇺🇸 Desktop akirna 🗽 ls| I get: 🇺🇸 Desktop akirna 🗽 ls | << weird

Swift - Replacing emojis in a string with whitespace

∥☆過路亽.° 提交于 2019-12-06 08:41:29
问题 I have a method that detects urls in a string and returns me both the urls and the ranges where they can be found. Everything works perfectly until there are emojis on the string. For example: "I'm gonna do this callenge as soon as I can swing again 😂😂😂\n http://youtu.be/SW_d3fGz1hk" Because of the emojis, the url extracted from the text is http://youtu.be/SW_d3fGz1 instead of http://youtu.be/SW_d3fGz1hk. I figured that the easiest solution was to just replace the emojis on the string with