本文整理汇总了C++中Collator::getAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ Collator::getAttribute方法的具体用法?C++ Collator::getAttribute怎么用?C++ Collator::getAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Collator
的用法示例。
在下文中一共展示了Collator::getAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void UCollationPCE::init(const Collator &coll)
{
UErrorCode status = U_ZERO_ERROR;
strength = coll.getAttribute(UCOL_STRENGTH, status);
toShift = coll.getAttribute(UCOL_ALTERNATE_HANDLING, status) == UCOL_SHIFTED;
isShifted = FALSE;
variableTop = coll.getVariableTop(status);
}
示例2: errln
// @bug 4058613
//
// Collator::createInstance() causes an ArrayIndexOutofBoundsException for Korean
//
void CollationRegressionTest::Test4058613(/* char* par */)
{
// Creating a default collator doesn't work when Korean is the default
// locale
Locale oldDefault = Locale::getDefault();
UErrorCode status = U_ZERO_ERROR;
Locale::setDefault(Locale::getKorean(), status);
if (U_FAILURE(status))
{
errln("Could not set default locale to Locale::KOREAN");
return;
}
Collator *c = NULL;
c = Collator::createInstance("en_US", status);
if (c == NULL || U_FAILURE(status))
{
errln("Could not create a Korean collator");
Locale::setDefault(oldDefault, status);
delete c;
return;
}
// Since the fix to this bug was to turn off decomposition for Korean collators,
// ensure that's what we got
if (c->getAttribute(UCOL_NORMALIZATION_MODE, status) != UCOL_OFF)
{
errln("Decomposition is not set to NO_DECOMPOSITION for Korean collator");
}
delete c;
Locale::setDefault(oldDefault, status);
}