gpt4 book ai didi

c++ - 如何将 sqlite3_mprintf() 与 UTF-16 字符串一起使用?

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:56:57 24 4
gpt4 key购买 nike

为什么没有sqlite3_mprintf16()函数?我需要“%q”功能,但需要 UTF-16 字符串。

最佳答案

Why there is no sqlite3_mprintf16() function?

因为 SQLite 还没有被 UTF-16 感染。它在界面中几乎所有地方都使用 UTF-8,因此格式化以 UTF-16 字符串编码的查询是没有意义的。

I need the '%q' functionality but for UTF-16 string.

这是一个不同的故事。您需要的是类似“%q16”的内容,但实际上并不存在。

也就是说,你根本不应该使用 sqlite3_mprintf。请改用准备好的语句和绑定(bind)函数。它们允许您使用 sqlite3_bind_text16 绑定(bind) UTF-16 字符串。更好的是,stop using UTF-16 for your strings .

关于c++ - 如何将 sqlite3_mprintf() 与 UTF-16 字符串一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8429022/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com