We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I've just seen some crash logs in my app from this code:
} else if (sqlite3_column_text(statement,x) != NULL) { [data addObject:@((char*)sqlite3_column_text(statement,x))]; }
Putting non-UTF8 characters into it seems to crash it (or at least it did when trying to display some Swedish text). I managed to fix it using this:
NSString *s = [NSString stringWithCString:(char *)sqlite3_column_text(statement,x) encoding:NSUTF8StringEncoding]; if (s == nil) { s = [NSString stringWithCString:(char *)sqlite3_column_text(statement,x) encoding:NSASCIIStringEncoding]; } [data addObject:s];
Not ideal, but it works for now. Might be worth looking into this though.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I've just seen some crash logs in my app from this code:
} else if (sqlite3_column_text(statement,x) != NULL) {
[data addObject:@((char*)sqlite3_column_text(statement,x))];
}
Putting non-UTF8 characters into it seems to crash it (or at least it did when trying to display some Swedish text). I managed to fix it using this:
NSString *s = [NSString stringWithCString:(char *)sqlite3_column_text(statement,x) encoding:NSUTF8StringEncoding];
if (s == nil) {
s = [NSString stringWithCString:(char *)sqlite3_column_text(statement,x) encoding:NSASCIIStringEncoding];
}
[data addObject:s];
Not ideal, but it works for now. Might be worth looking into this though.
The text was updated successfully, but these errors were encountered: