将用户定义的规则添加到现有语言
任何人都可以解释一下以语言加载现有规则并向其中添加一些新规则的正确方法是什么。 我执行以下操作,但未设置规则。
void CompareTest()
{
UErrorCode status = U_ZERO_ERROR;
UChar ruleset[500]; *ruleset = 0;
int32_t rlen = 0;
UCollator *coll = ucol_open("de_DE", &status);
static const UChar rules[] = L"&\\u0000 = '' = '-'";
int32_t len=(int32_t)u_strlen(rules);
const UChar *defRules = ucol_getRules(coll, &rlen);
if(rlen > 0)
{
u_strcpy(ruleset, defRules);
}
u_strcat(ruleset, rules);
status = U_ZERO_ERROR;
UCollator *collRule = ucol_openRules(ruleset, u_strlen(ruleset),
UCOL_OFF,
UCOL_DEFAULT_STRENGTH,NULL, &status);
can anybody explain what the correct way is to load existing rules in a language and add some new to them.
I do the following but the rule is not set.
void CompareTest()
{
UErrorCode status = U_ZERO_ERROR;
UChar ruleset[500]; *ruleset = 0;
int32_t rlen = 0;
UCollator *coll = ucol_open("de_DE", &status);
static const UChar rules[] = L"&\\u0000 = '' = '-'";
int32_t len=(int32_t)u_strlen(rules);
const UChar *defRules = ucol_getRules(coll, &rlen);
if(rlen > 0)
{
u_strcpy(ruleset, defRules);
}
u_strcat(ruleset, rules);
status = U_ZERO_ERROR;
UCollator *collRule = ucol_openRules(ruleset, u_strlen(ruleset),
UCOL_OFF,
UCOL_DEFAULT_STRENGTH,NULL, &status);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在对你的其他问题的回答中部分回答了 - 我不知道我看不出您使用 API 本身的方式有什么问题,但是您无法定制“''”。使用另一个问题中给出的解决方案。或者,也许您可以更多地解释一下您正在尝试做什么。
I partially answered in my answer to your other question - I don't see anything wrong with how you are using the API itself, however you cannot tailor "''". Use the solution given in the other question. Or, maybe you can explain a bit more about what you are trying to do.