I'm developing an Iphone application that uses non-english strings (Hebrew) in sqlite3 DB.
However, the application only displays my data when using english strings! Values with hebrew characters returns null.
I've tried adding hebrew strings through sqlite on the mac, in the terminal - but sqlite won't even recognize the characters as I type them (altough terminal does).
So I've tried making the database in windows. The database accepted my special characters so I've transferred it to mac. Characters still weren't displayed on the Iphone.
When checking it in sqlite in the terminal, these were the results I've recieved, with question marks instead of chars:
1|???? ????? ??? ??? ????|31|34
2|???? ????? ??? ??? ????|31|34
3|???? ????? ????? - ???|31|34
When the iphone retrieves the data in the app, with the code:
NSLog(@"Name: %@", [NSString stringWithUTF8String:(char *) sqlite3_column_text(compiledStatement, 1)]);
All I get is null values:
2010-09-11 13:20:20.096 tr[928:207] Name: (null)
2010-09-11 13:20:20.096 tr[928:207] Name: (null)
2010-09-11 13:20:20.097 tr[928:207] Name: (null)
What else could I b开发者_StackOverflow中文版e trying?
Thanks!
Found the solution...
The content didn't pass well from the db3 file windows created.
So I've copied the actual sql commands to a txt file, and then in sqlite3 on the mac commenced all these commands (with ".read"). The result: Working UTF-8 characters :)
精彩评论