Update ICU to 60.1 + local patches
What's new in ICU 60.1:
- Unicode 10.0 (including Emoji 5.0)
- CLDR 32 (locale data; http://cldr.unicode.org/index/downloads/cldr-32 )
- Smaller rule file size for BreakIterator (no more reverse rules)
- A new number formatting API
- Malformed UTF-8 sequences are handled per W3C Encoding Standard
- See http://site.icu-project.org/download/60 for more details.
In addition, the following changes are made:
* Add more locale variants for en,fr,de,it,pt,nl,ru,ar
* Add the minimum locale data for Osage and Chakma
* Apply locale data patches (Google and Chromium)
* Apply build-related and break iterator patches:
wpo.patch
vscomp.patch
data.build.win.patch
data_symb.patch
cjdict.patch
khmer-dictbe.patch
wordbrk.patch
patches/data.build.patch
* Update BUILD.gn and gyp files.
* Data file size (25 ~ 130kB smaller than the latest 59.1)
android/icudtl.dat 6499904
common/icudtl.dat 10170896
ios/icudtl.dat 6486240
The update steps are recorded in
https://chromium.googlesource.com/chromium/deps/icu/+log/f88520f..1034c7e5 .
Bug: 766816
Test: None (DEPS roll CL will have test specified).
Change-Id: I9144bb37464eec1f282f40f9f2d28b6306511083
Reviewed-on: https://chromium-review.googlesource.com/756237
Reviewed-by: Mark Mentovai <mark@chromium.org>
diff --git a/source/common/unistr_case.cpp b/source/common/unistr_case.cpp
index 1c62ce5..2138d60 100644
--- a/source/common/unistr_case.cpp
+++ b/source/common/unistr_case.cpp
@@ -19,6 +19,7 @@
*/
#include "unicode/utypes.h"
+#include "unicode/brkiter.h"
#include "unicode/casemap.h"
#include "unicode/edits.h"
#include "unicode/putil.h"
@@ -104,6 +105,12 @@
UBool writable = isBufferWritable();
UErrorCode errorCode = U_ZERO_ERROR;
+#if !UCONFIG_NO_BREAK_ITERATION
+ // Read-only alias to the original string contents for the titlecasing BreakIterator.
+ // We cannot set the iterator simply to *this because *this is being modified.
+ UnicodeString oldString;
+#endif
+
// Try to avoid heap-allocating a new character array for this string.
if (writable ? oldLength <= UPRV_LENGTHOF(oldBuffer) : oldLength < US_STACKBUF_SIZE) {
// Short string: Copy the contents into a temporary buffer and
@@ -123,6 +130,12 @@
buffer = fUnion.fStackFields.fBuffer;
capacity = US_STACKBUF_SIZE;
}
+#if !UCONFIG_NO_BREAK_ITERATION
+ if (iter != nullptr) {
+ oldString.setTo(FALSE, oldArray, oldLength);
+ iter->setText(oldString);
+ }
+#endif
newLength = stringCaseMapper(caseLocale, options, UCASEMAP_BREAK_ITERATOR
buffer, capacity,
oldArray, oldLength, NULL, errorCode);
@@ -143,7 +156,13 @@
oldArray = getArrayStart();
Edits edits;
UChar replacementChars[200];
- stringCaseMapper(caseLocale, options | UCASEMAP_OMIT_UNCHANGED_TEXT, UCASEMAP_BREAK_ITERATOR
+#if !UCONFIG_NO_BREAK_ITERATION
+ if (iter != nullptr) {
+ oldString.setTo(FALSE, oldArray, oldLength);
+ iter->setText(oldString);
+ }
+#endif
+ stringCaseMapper(caseLocale, options | U_OMIT_UNCHANGED_TEXT, UCASEMAP_BREAK_ITERATOR
replacementChars, UPRV_LENGTHOF(replacementChars),
oldArray, oldLength, &edits, errorCode);
if (U_SUCCESS(errorCode)) {
@@ -179,6 +198,7 @@
return *this;
}
errorCode = U_ZERO_ERROR;
+ // No need to iter->setText() again: The case mapper restarts via iter->first().
newLength = stringCaseMapper(caseLocale, options, UCASEMAP_BREAK_ITERATOR
getArrayStart(), getCapacity(),
oldArray, oldLength, NULL, errorCode);