SQLite 3:按记录排序时的字符问题
在我的 SQLite 3 数据库中,我有一些带有土耳其字符的记录,例如“Ö”、“Ü”、“ı”等。当我使用 SELECT * FROM TABLE ORDER BY COLUMN_NAME
查询选择值时,以这些字符开头的记录将出现在最后。
通常,它们应该位于每个字母的无点版本之后。就像“Ö”在“O”之后,“Ü”在“U”之后。
与区域设置有关吗?有没有办法控制这些设置?
我使用 Firefox 中的 SQLite Manager 来管理我的数据库。
提前致谢。
PS我知道这不是SQLite的解决方案,但对于那些需要在Objective-C中使用SQLite DB的人来说,他们可以在从SQLite DB获取数据后对数据数组进行排序。这是一个很好的解决方案:如何使用自定义对 NSMutableArray 进行排序其中的对象?
In my SQLite 3 Database, I have some records with Turkish characters such as "Ö", "Ü", "İ" etc. When I select my values with SELECT * FROM TABLE ORDER BY COLUMN_NAME
query, the records that begin with these characters are coming at the end.
Normally, they should've come after the letter that is dot-less version of each. Like "Ö" is after "O", "Ü" is after "U".
Is it something about regional settings? Is there a way to control these settings?
I use SQLite Manager in Firefox to manage my DB.
Thanks in advance.
P.S. I know it's not a solution for SQLite but for those who need to use SQLite DB in Objective-C, they can sort the data array after getting from SQLite DB. Here's a good solution: How to sort an NSMutableArray with custom objects in it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,似乎没有直接的解决方案。至少对于 iOS 来说是这样。但有一些方法可以遵循。
在我订阅了 SQLite 的邮件列表后,名为 Jean-Christophe Deschamps 的用户收到了这样的回复:
Unfortunately, it seems there's no direct solution for this. For iOS at least. But there are ways to follow.
After I subscribed to mailing list of SQLite, user Named Jean-Christophe Deschamps came with this reply:
这可能是区域设置的问题,但首先我会验证是否使用了 UTF-8 编码。
It could be the regional settings but first I would verify UTF-8 encoding is being used.