Add emoji / emoticon to SQL Server table

Use NVARCHAR(size) datatype and prefix string literal with N: CREATE TABLE #tab(col NVARCHAR(100)); INSERT INTO #tab(col) VALUES (N’👍 🖒 🖓 🖕 🗑 🛦 ⁉ 😎 😔 😇 😥 😴 😭’); SELECT * FROM #tab; db<>fiddle demo Output: ╔═════════════════════════════════╗ ║ col ║ ╠═════════════════════════════════╣ ║ 👍 🖒 🖓 🖕 🗑 🛦 ⁉ 😎 😔 😇 😥 😴😭 … Read more

Displaying emoticons in Android

I think it would be more useful to build Spannable. private static final Factory spannableFactory = Spannable.Factory .getInstance(); private static final Map<Pattern, Integer> emoticons = new HashMap<Pattern, Integer>(); static { addPattern(emoticons, “:)”, R.drawable.emo_im_happy); addPattern(emoticons, “:-)”, R.drawable.emo_im_happy); // … } private static void addPattern(Map<Pattern, Integer> map, String smile, int resource) { map.put(Pattern.compile(Pattern.quote(smile)), resource); } public static … Read more

Incorrect string value: ‘\xF0\x9F\x8E\xB6\xF0\x9F…’ MySQL

I was finally able to figure out the issue. I had to change some settings in mysql configuration my.ini This article helped a lot http://mathiasbynens.be/notes/mysql-utf8mb4#character-sets First i changed the character set in my.ini to utf8mb4 Next i ran the following commands in mysql client SET NAMES utf8mb4; ALTER DATABASE dreams_twitter CHARACTER SET = utf8mb4 COLLATE … Read more

What is this smiley-with-beard expression: “”?

The program uses digraphs to represent the following: [] {}; This is a lambda expression that does nothing. The corresponding symbols have these equivalents: <: = [ %> = } Though they are generally unneeded today, digraphs are useful for when your keyboard lacks certain keys necessary to use C++’s basic source character set, namely … Read more

tech