开发者

SQLite - Insert special symbols (trademark, ...) into table

开发者 https://www.devze.com 2023-01-17 02:40 出处:网络
How 开发者_StackOverflowcan I insert special symbols like trademark into SQLite table? I have tried to use PRAGMA encoding = \"UTF-16\" with no effect :(Typically if you surround an SQL entry with \'\

How 开发者_StackOverflowcan I insert special symbols like trademark into SQLite table? I have tried to use PRAGMA encoding = "UTF-16" with no effect :(


Typically if you surround an SQL entry with ''Single quotes, it goes in as a literal.

i.e.

'™'


problem solved. it is necessary to open DB file with sqlite3_open16, then execute command PRAGMA encoding = \"UTF-16\"; (I am not sure, if it is necessary). Now the insert will be done with UTF-16. To select from db (to get column value) is necessary to use sqlite3_column_text16 function

0

精彩评论

暂无评论...
验证码 换一张
取 消