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.
Here is the alternative answer:
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
viewDidLoad
I call[self loadNamesFromDatabase];
which looks like:and the
MyCallback
function you see there is as follows:where
drivers
is anNSMutableArray
. The key thing here isstringWithUTF8String
and you would not need to use the code at the top as all data should be encoded properly and thus will be presented correctly.const char *utfString = [strText cStringUsingEncoding:NSMacOSRomanStringEncoding];
Can you try another font style. e.g.;
And what it seems on NSLog lines?