Click here to Skip to main content
15,886,817 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
need to store emoji
When i store and retrieve "text and emoji" in a single column, I'm getting ?? in the place of emoji.
EX:input : Hi friends😘
in database: Hi friends?
in View: Hi friends?

What I have tried:

need to store emoji
When i store and retrieve "text and emoji" in a single column, I'm getting ?? in the place of emoji.
EX:input : Hi friends😘
in database: Hi friends?
in View: Hi friends?
Posted
Updated 27-Mar-19 22:47pm
Comments
Santosh kumar Pithani 28-Mar-19 8:15am    
If you know difference between Char,NChar and varchar,Nvarchar then its easy to understand.Some datatypes designed to support especial characters like you question.
ex:DECLARE @Emoji TABLE(A NVARCHAR(500),B VARCHAR(500));

INSERT INTO @Emoji(A,B)
SELECT N'Hi friends😘', N'Hi friends😘';

SELECT * FROM @Emoji;

1 solution

The database will store whatever you pass to it. When you read it back and display it you need to recognise that it is an emoji character, and select the appropriate font for display.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900