Reputation: 611
I have stored the name called Désirée Allenspach in sqlite DB as a varchar.When I read this into a NSString
variable to display in UITableView
as a textlabel
//cell.textLabel.text = name;
It is not dispalyed as it is supposed to be.
I want to display it as Désirée Allenspach only without adding any extra character. Please help me
Upvotes: 1
Views: 1522
Reputation: 31720
Use stringWithCString
method to encode your NSString
object in NSUTF8StringEncoding
.
NSString* myString = [NSString stringWithCString:[specialCharConatiningString fileSystemRepresentation] encoding:NSUTF8StringEncoding]];
myLabel.text = myString;
Upvotes: 0
Reputation: 21599
What encoding are you using to store it in the database, and what encoding are you using to read it back out? You don't say what the problem is exactly, but assuming it's that you have garbage characters where the accents are, it's almost certainly an encoding issue at the storage layer, not a problem with your cell.
Upvotes: 1