diff --git a/third_party/icu4c/libicu.ndk.json b/third_party/icu4c/libicu.ndk.json index 40397f05313206cd8d4413e4e0f1142a8aabc6a3..42149b48ee8e15acef291cf765991bbae222c418 100644 --- a/third_party/icu4c/libicu.ndk.json +++ b/third_party/icu4c/libicu.ndk.json @@ -187,6 +187,10 @@ "first_introduced": "12", "name":"ubrk_setText" }, + { + "first_introduced": "20", + "name":"ubrk_setUText" + }, { "first_introduced": "12", "name":"ubrk_current" diff --git a/third_party/icu4c/ndk_headers/unicode/ubrk.h b/third_party/icu4c/ndk_headers/unicode/ubrk.h index 9724bcf56944e66b2a0093d4e2fde6c576494540..98a27959a3cc28c526d41aa55caf7d2fca8738e6 100644 --- a/third_party/icu4c/ndk_headers/unicode/ubrk.h +++ b/third_party/icu4c/ndk_headers/unicode/ubrk.h @@ -12,6 +12,7 @@ #include "unicode/utypes.h" #include "unicode/uloc.h" +#include "unicode/utext.h" #if U_SHOW_CPLUSPLUS_API #include "unicode/localpointer.h" @@ -338,6 +339,28 @@ ubrk_setText(UBreakIterator* bi, int32_t textLength, UErrorCode* status); +/** + * Sets an existing iterator to point to a new piece of text. + * + * All index positions returned by break iterator functions are + * native indices from the UText. For example, when breaking UTF-8 + * encoded text, the break positions returned by \ref ubrk_next, \ref ubrk_previous, etc. + * will be UTF-8 string indices, not UTF-16 positions. + * + * @param bi The iterator to use + * @param text The text to be set. + * This function makes a shallow clone of the supplied UText. This means + * that the caller is free to immediately close or otherwise reuse the + * UText that was passed as a parameter, but that the underlying text itself + * must not be altered while being referenced by the break iterator. + * @param status The error code + * @stable ICU 3.4 + */ +U_CAPI void U_EXPORT2 +ubrk_setUText(UBreakIterator* bi, + UText* text, + UErrorCode* status); + /** * Determine the most recently-returned text boundary. *