From 80a648c3d5eb7ad8b2fb89a852351060edc80ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=89=91?= Date: Tue, 8 Apr 2025 19:16:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E9=BD=90=E6=96=AD=E8=AF=8D=E6=8D=A2?= =?UTF-8?q?=E8=A1=8CNDK=E4=B8=ADubrk=5FsetUText=E3=80=81=E5=92=8Cubrk=5Fcl?= =?UTF-8?q?one=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王剑 --- third_party/icu4c/libicu.ndk.json | 4 ++++ third_party/icu4c/ndk_headers/unicode/ubrk.h | 22 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/third_party/icu4c/libicu.ndk.json b/third_party/icu4c/libicu.ndk.json index 40397f053..2313651a5 100644 --- a/third_party/icu4c/libicu.ndk.json +++ b/third_party/icu4c/libicu.ndk.json @@ -2086,5 +2086,9 @@ { "first_introduced": "15", "name":"u_errorName" + }, + { + "first_introduced": "18", + "name":"ubrk_setUText" } ] diff --git a/third_party/icu4c/ndk_headers/unicode/ubrk.h b/third_party/icu4c/ndk_headers/unicode/ubrk.h index 9724bcf56..e976eca24 100644 --- a/third_party/icu4c/ndk_headers/unicode/ubrk.h +++ b/third_party/icu4c/ndk_headers/unicode/ubrk.h @@ -338,6 +338,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. * -- Gitee