I am new to iOS programming. I am developing an app which gets some sentences from my web service which I insert into my local database However, some sentences contain turkish characters such as; “ü, ğ, ç, ö”. I can insert these characters to in my database fine, but when I output them to a UILabel it looks like: “≈ü ƒü √º √∂”. I have tried to convert to NSUTF8StringEncoding but to no avail.
I have an NSMutableArray, named questions, which contains some turkish characters. How can I convert this Array to NSUTF8String format?
Sorry for my bad english 🙂 Thanks.
Ahh, I think the problem is not that you need to convert your array – it is how you display the strings.
Check this code which has an array of Turkish footballers:
It should now display the title of the page as “Emre Belözoğlu” in correct formatting.
The problem could alternatively be with the way the data is parsed from the SQLite to your
NSMutableArray. Here is how I have achieved it for a Formula 1 app.In
viewDidLoadI call[self loadNamesFromDatabase];which looks like:and the
MyCallbackfunction you see there is as follows:where
driversis anNSMutableArray. The key thing here isstringWithUTF8Stringand you would not need to use the code at the top as all data should be encoded properly and thus will be presented correctly.