For my app I want to be able to use unicode caracters like \n, and these ones : http://www.easyapns.com/category/just-for-fun
The text is stored in a sqlite3 database, and when I read it, I get for example the text \ue415 instead of the smiley. I neither have a line break, but a \n .
I'm able to display the smileys and line breaks using this piece of code :
NSString* unicodeString = [myString stringByReplacingOccurrencesOfString:@"\\n" withString:@"\n"];
unicodeString = [unicodeString stringByReplacingOccurrencesOfString:@"\\ue022" withString:@"\ue022"];
// etc...
But I would like to find a generic way to do this, in order to be able to display all the unicode caracters.
I'm getting the text from my sqlite3 database this way :
NSString* title = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 3)];
I tried to replace \\ by \, but it is not possible to write the string @"\", because it escapes the " ... I tried to replace \\\\ by \\, but it doesn't work. I also tried to get the string from the database using other encoding, without success...
Any idea ?