Why there is no sqlite3_mprintf16() function? I need the ‘%q’ functionality but for UTF-16 string.
Why there is no sqlite3_mprintf16() function? I need the ‘%q’ functionality but for UTF-16
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because SQLite is not infected by UTF-16 yet. It uses UTF-8 almost everywhere in the interface, and so there’s no point in formatting a query encoded in UTF-16 string.
This is a different story. What you need is something like ‘%q16’, which in fact doesn’t exist.
Said that, you shall not use
sqlite3_mprintfat all. Use prepared statements and bind functions instead. They do allow you to bind a UTF-16 string usingsqlite3_bind_text16. Even better, stop using UTF-16 for your strings.