Google Gears 的 SQLite 字符编码
我们使用 jQuery 从服务器获取 JSON 字符串(UTF-8 响应,也是通过 jQuery 的 UTF-8 请求),并将此 JSON 放入 Google Gears WorkerPool 中。该工作池处理 JSON 并将其存储到 Gears 数据库 (SQLite) 中。
事实证明,SQLite 显然使用 iso-8859-1 而不是 UTF-8 存储数据。由于我们尝试存储可能包含西里尔字符(以及您在欧洲可能遇到的其他字符)的用户名,因此这会出现严重错误。
谁能告诉我如何更改 Gears WorkerPool 或 Gears 使用的 SQLite 数据库中的字符编码?当然,如果我的问题方向错误,请随时提供替代方案!
不幸的是,HTML5 不是一个选项,因为我们应该主要支持 IE7。
We're using jQuery to get a JSON-string from our server (UTF-8 response, also UTF-8 request through jQuery) and put this JSON into a Google Gears WorkerPool. This workerpool processes the JSON and stores it into a Gears database (SQLite).
It turns out that, apparently, SQLite stores data using iso-8859-1 rather than UTF-8. Since we're trying to store user names that might contain Cyrillic characters (and others that you might encounter in Europe), this goes horribly wrong.
Can anyone tell me how to change the character encoding in either the Gears WorkerPool or the SQLite database that Gears employs? Of course, if I'm looking in the wrong direction with my problem, feel free to offer alternatives!
Unfortunately, HTML5 isn't an option as we're supposed to support IE7 primarily.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在定义任何表之前尝试“PRAGMA编码='utf-8'”。
请参阅此链接
和此链接用于 SQLites PRAGMA 语法
Try "PRAGMA encoding='utf-8' " before you define any tables.
see This link
And this link for SQLites PRAGMA syntax