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

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -