Skip to content

[USE_ICU=1] Always failed with U_MISSING_RESOURCE_ERROR after calling ubrk_open() #14753

@shiqp

Description

@shiqp

We want to achieve a text break iterator based on ICU for our wasm project. However, when we call ubrk_open() to create an instance, it always failed with U_MISSING_RESOURCE_ERROR.

bool TextBreakIteratorImpl::Init() {
UErrorCode status = U_ZERO_ERROR;
switch (break_type_) {
case TextBreakIterator::TextBreakType::BREAK_NEWLINE: {
iter_ = ubrk_open(UBRK_LINE, nullptr, nullptr, 0, &status);
break;
}
case TextBreakIterator::TextBreakType::BREAK_WORD: {
iter_ = ubrk_open(UBRK_WORD, nullptr, nullptr, 0, &status);
break;
}
}

if (U_FAILURE(status) || iter_ == nullptr) {
return false;
}

return true;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions