我有一個標籤,我必須從數據庫中提取一箇中文字符串,但沒有出現。我注意到該字符串不是從數據庫中提取的,而其他所有的工作都是正確的。我能做什麼?標籤文本中的中文字符串
char *subTitle= (char*)sqlite3_column_text(statement,13);
NSLog(@" The sutitle is %s", subTitle);
//The sutitle is
rowTable.sottotitolo = [[NSString alloc]initWithUTF8String: subTitle];
NSLog(@"The subtitle is %@", rowTable.sottotitolo);
//The subtitle is
使用除西方字母以外的方法?
NSLog(@"The string in chinese is %@", self.chinaTable.subtitle);
//The string in chinese is
//is not printed to the screen,but the database is written correctly
self.labelTitle.text = self.chinaTable.subtitle;
//empty out
在此先感謝
也許你需要使用能夠顯示中文字符的字體? – kitschmaster
UTF8String不支持 – NANNAV
你可以在這裏得到幫助http://stackoverflow.com/questions/2115359/how-to-read-chinese-characters – spider1983