Tag: 缺点

NSString const char *与希腊字符转换

我试图将一个包含希腊字的NSString转换为一个const char。 我想转换string与UTF-8编码这是希腊语,当我logging的字符,它有垃圾。 请在这里一点帮助.. //this is the greek word NSString *letter = textFieldLetter.text; //NSString to const char conversion for the sql query const char *cLetter = (const char *)[letter cStringUsingEncoding:NSUTF8StringEncoding]; //this contains junk! NSLog(@"letter: %s",cLetter);