iOS, sqlite3 & unicode char -


for app want able use unicode caracters \n, , these ones : http://www.easyapns.com/category/just-for-fun

the text stored in sqlite3 database, , when read it, example text \ue415 instead of smiley. neither have line break, \n .

i'm able display smileys , line breaks using piece of code :

nsstring* unicodestring = [mystring stringbyreplacingoccurrencesofstring:@"\\n" withstring:@"\n"]; unicodestring = [unicodestring stringbyreplacingoccurrencesofstring:@"\\ue022" withstring:@"\ue022"]; // etc... 

but find generic way this, in order able display unicode caracters.

i'm getting text sqlite3 database way :

nsstring* title = [nsstring stringwithutf8string:(char *)sqlite3_column_text(statement, 3)]; 

i tried replace \\ \, not possible write string @"\", because escapes " ... tried replace \\\\ \\, doesn't work. tried string database using other encoding, without success...

any idea ?

i found solution there (not accepted answer, 1 nikolai ruhe) :

using objective c/cocoa unescape unicode characters, ie \u1234

nsstring* convertedstring = [mystring mutablecopy]; cfstringref transform = cfstr("any-hex/java"); cfstringtransform((__bridge cfmutablestringref)convertedstring, null, transform, yes); 

it not escape \n though, can easilly done stringbyreplacingoccurrencesofstring.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -