emscripten-core / emscripten-core/emscripten
[USE_ICU=1] Always failed with U_MISSING_RESOURCE_ERROR after calling ubrk_open()
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 109
Description
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;
}
Contributor guide
Assessment
This issue has not been assessed yet.