如何在带有指定语言环境的sqlite3中对文本排序? [英] How to sort text in sqlite3 with specified locale?

查看:101
本文介绍了如何在带有指定语言环境的sqlite3中对文本排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Sqlite3默认情况下仅按ASCII字母排序.我试图在google中查找内容,但发现的唯一内容是有关归类的信息. Sqlite3仅具有NOCASERTRIMBIARY归类.如何添加对特定语言环境的支持? (我在Rails应用程序中使用它)

Sqlite3 by default sorts only by ascii letters. I tried to look in google, but the only thing I found were informations about collations. Sqlite3 has only NOCASE, RTRIM and BIARY collations. How to add support for a specific locale? (I'm using it in Rails application)

推荐答案

SQLite ICU 集成.根据自述文件, sqlite/ext/icu/README.txt sqlite/ext/icu/目录包含SQLite"ICU"扩展名的源代码, 将"Unicode的国际组件"库与SQLite集成.

SQLite supports integration with ICU. According to the Readme file, sqlite/ext/icu/README.txt the sqlite/ext/icu/ directory contains source code for the SQLite "ICU" extension, an integration of the "International Components for Unicode" library with SQLite.

1. Features

    1.1  SQL Scalars upper() and lower()
    1.2  Unicode Aware LIKE Operator
    1.3  ICU Collation Sequences
    1.4  SQL REGEXP Operator

这篇关于如何在带有指定语言环境的sqlite3中对文本排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆