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
Post a Comment