Case-insensitive UTF-8 string collation for SQLite (C/C++)

前端 未结 6 803
一个人的身影
一个人的身影 2021-02-09 04:58

I am looking for a method to compare and sort UTF-8 strings in C++ in a case-insensitive manner to use it in a custom collation function in SQLite.

  1. The method shou
6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-09 05:42

    On Windows you can call fall back on the OS function CompareStringW and use the NORM_IGNORECASE flag. You'll have to convert your UTF-8 strings to UTF-16 first. Otherwise, take a look at IBM's International Components for Unicode.

提交回复
热议问题