ios - How to save an emoji into database? -


i've string holds πŸ†Ž emoji , wants store sqlite database, string coming server, string can in combinations of, emojis, emojis + text, , text. how handle , store each string i'll server.

i've code, store / retrive texts database , working fine. when got emoji in texts, changing output, , instead of emoji showing me random characters this, 🆎.

how handle case?

as per answer

sqlite stores text data unicode string.

previosly retriving text this,

nsstring *text = [nsstring stringwithformat:@"%s",sqlite3_column_text(statement, 0)]; 

i changed this,

nsstring *text = [nsstring stringwithutf8string:(const char *)sqlite3_column_text(statement, 0)]; 

and working fine now.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -