boost::locale icu sortKey
boost::locale icu sortKey
我正在写代码,在数据库中制作索引。有了ICU图书馆,我的工作流程是:
- 用户区域设置中的字符串->
转换为utf8->
normalize utf8->
调用ICUucol_getSortKey
获取建筑索引的排序键
现在我切换到Boost Locale。Boost Locale可以构建像ICU这样的排序键吗?或者我应该直接打电话给重症监护室?
看起来这就是Boost Locale所知道的collate_impl::do_[basic_]transform()
:
std::vector<uint8_t> do_basic_transform(level_type level,CharType const *b,CharType const *e) const
{
icu::UnicodeString str=cvt_.icu(b,e);
std::vector<uint8_t> tmp;
tmp.resize(str.length());
icu::Collator *collate = get_collator(level);
int len = collate->getSortKey(str,&tmp[0],tmp.size());
if(len > int(tmp.size())) {
tmp.resize(len);
collate->getSortKey(str,&tmp[0],tmp.size());
}
else
tmp.resize(len);
return tmp;
}
std::basic_string<CharType> do_transform(level_type level,CharType const *b,CharType const *e) const
{
std::vector<uint8_t> tmp = do_basic_transform(level,b,e);
return std::basic_string<CharType>(tmp.begin(),tmp.end());
}
为了提高性能,您似乎希望调用do_basic_compare
相关文章:
- 如何在 Linux for Windows 上通过 MinGW 构建静态 ICU 的 Boost
- 检测 ICU 库在 VS2017 中失败
- 如何调整ICU的UnicodeString::caseCompare(或获得相同的效果)
- 如何将ICU库添加到ARM的Qt项目中
- 在带有brew的MacOS上链接时缺少增强ICU正则表达式符号
- Ubuntu上的库ICU不想从Unicode转换为Windows-1251
- 默认区域设置"root"在 ICU 中如何工作?
- ICU 的未解析外部符号
- icu::SimpleDate格式使用未定义类型的编译器错误
- 如何在 c++ Linux 中使用 ICU 库将 UnicodeString 转换为 windows-1251
- 构建适用于 iOS 的 ICU
- Unicode - ICU 库 - 获取 UnicodeString 中的代码点计数
- C :如何使用ICU通过给定的时区偏移来获得当前时间
- C ICU库如何确定要缓存的日历对象
- ICU结合泰语元音符号和何时忽略
- 在将 cmake 项目与 Qt5 链接时部署 icu 库
- 如何与ICU 57.1 mingw静态链接我的应用程序
- UTF-8到UCS-2与icu库的转换
- 如何使用CMake部署ICU库
- boost::locale icu sortKey