0

Hello freinds i am trying to insert some danish text in my table of sqlite3 db and for that i m inserting it as...

NSString  *sqlTemp =[NSString stringWithFormat:
  @"INSERT INTO myTable (firstArg,secondArg,thirdArg,fourthArg) VALUES ('%@','%@','%@','%@')",
  txt1,text2,txt3,txt4];
const char *sql = [sqlTemp UTF8String];

type of all arguements while creating table is declared as "text".

the issue is when i retreive the data from db and want to set as text of uitextview it is diplaying somthing like "√Ö√¶√∏√¶" for danish text "Åæøæ"

Can any one suggest some solution for this .

Thanks in advance

Paggyy

zed_0xff
  • 32,417
  • 7
  • 53
  • 72
user968597
  • 1,164
  • 2
  • 15
  • 30

2 Answers2

0

Set your datatype to nvarchar.

BizApps
  • 6,048
  • 9
  • 40
  • 62
0

You should use the sqlite3_bind_text function which binds your text using its UTF8 representation, check the answer of Storing and retrieving data from sqlite database, where you can find a complete example of how to insert such data into a database.

Community
  • 1
  • 1
Mousa
  • 2,926
  • 1
  • 27
  • 35