Xcode Sqlite Turkish Character Encoding

We have entries such as "GÜLHAN", "Yılan", "çekiç" in our Sqlite database.
These words include Turkish characters, and the problem is that we cannot read these words correctly; we read "GEDf∞k" instead of "GEDİK".

How can we solve this sqlite reading problem in xcode?

+3
source share
1 answer

What encoding did you use to store data in the database? There should be no problem if it is UTF8.

char *data = (char *) sqlite3_column_text (stmt, 1);
NSString *string = [NSString stringWithUTF8String:data];

If this gives you unexpected results, then this is not UTF8, and it is probably a good idea to transcode everything in the database to UTF8 first.

+2
source

All Articles