Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android版本如何支持LOCALIZED排序? #573

Open
HadenShi opened this issue Aug 6, 2019 · 2 comments
Open

Android版本如何支持LOCALIZED排序? #573

HadenShi opened this issue Aug 6, 2019 · 2 comments
Assignees
Labels

Comments

@HadenShi
Copy link

HadenShi commented Aug 6, 2019

如题

@smilewaver
Copy link

smilewaver commented Jan 22, 2021

同遇这个问题,这么久了,不打算支持吗

Caused by: com.tencent.wcdb.database.SQLiteException: no such collation sequence: LOCALIZED (code 1, errno 0): , while compiling: SELECT _id, buid, name, display, icon, starred, is_muted, type, last_active_times FROM friends WHERE ( LOWER(_alias_sl) GLOB ? OR LOWER(_alias_sl) GLOB ?) AND (buid NOT GLOB ';' OR buid GLOB ';') ORDER BY name COLLATE LOCALIZED ASC

@smilewaver
Copy link

smilewaver commented Jan 29, 2021

已解决;

  1. 开启 SQLITE_ENABLE_ICU 和 U_DISABLE_RENAMING 宏;
  2. 补齐 icuprototype.h 中缺失的 icu 动态函数原型;
  3. sqlite3.c 中添加 #include "icucompat.h" 依赖,将 icu 相关调用转为 g_icucompat_iface.xxx 调用;
  4. SQLiteGlobal nativeInitialize流程中添加 init_icucompat 初始化流程;
  5. 关闭所有 NO_LOCALIZED_COLLATORS 相关flag代码;
  6. 迁移 android COLLATE LOCALIZED 相关系统源码(sqlite3_android.h/cpp);
  7. 补齐 nativeRegisterLocalizedCollators 流程;

缺陷:

  1. 可能有icu动态函数与线上环境不匹配风险;
  2. 如有需求,诸如tokenize, function等扩展能力还需一一适配;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants