diff options
author | Steven R. Loomis <srloomis@us.ibm.com> | 2017-09-21 15:31:38 -0700 |
---|---|---|
committer | Steven R. Loomis <srloomis@us.ibm.com> | 2017-11-09 18:25:58 -0800 |
commit | 44d3e17985befbd45457d5ad7f0a0387849e1b2f (patch) | |
tree | f75f2eddb868f13254b7f514875534dee616c0d6 /deps/icu-small/source/common/unistr_titlecase_brkiter.cpp | |
parent | 3b3ceafaf922e1d79950595eaa501aa412913820 (diff) | |
download | android-node-v8-44d3e17985befbd45457d5ad7f0a0387849e1b2f.tar.gz android-node-v8-44d3e17985befbd45457d5ad7f0a0387849e1b2f.tar.bz2 android-node-v8-44d3e17985befbd45457d5ad7f0a0387849e1b2f.zip |
deps: ICU 60 bump
- Update to released ICU 60.1, including:
- CLDR 32 (many new languages and data improvements)
- Unicode 10 (8,518 new characters, including four new scripts,
7,494 new Han characters, and 56 new emoji characters)
- UTF-8 malformed bytes now handled according to W3C/WHATWG spec
Fixes: https://github.com/nodejs/node/issues/15540
PR-URL: https://github.com/nodejs/node/pull/16876
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/icu-small/source/common/unistr_titlecase_brkiter.cpp')
-rw-r--r-- | deps/icu-small/source/common/unistr_titlecase_brkiter.cpp | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/deps/icu-small/source/common/unistr_titlecase_brkiter.cpp b/deps/icu-small/source/common/unistr_titlecase_brkiter.cpp index 3156fdfc57..4969884b0d 100644 --- a/deps/icu-small/source/common/unistr_titlecase_brkiter.cpp +++ b/deps/icu-small/source/common/unistr_titlecase_brkiter.cpp @@ -30,36 +30,26 @@ U_NAMESPACE_BEGIN UnicodeString & -UnicodeString::toTitle(BreakIterator *titleIter) { - return toTitle(titleIter, Locale::getDefault(), 0); +UnicodeString::toTitle(BreakIterator *iter) { + return toTitle(iter, Locale::getDefault(), 0); } UnicodeString & -UnicodeString::toTitle(BreakIterator *titleIter, const Locale &locale) { - return toTitle(titleIter, locale, 0); +UnicodeString::toTitle(BreakIterator *iter, const Locale &locale) { + return toTitle(iter, locale, 0); } UnicodeString & -UnicodeString::toTitle(BreakIterator *titleIter, const Locale &locale, uint32_t options) { - BreakIterator *bi=titleIter; - if(bi==NULL) { - UErrorCode errorCode=U_ZERO_ERROR; - bi=BreakIterator::createWordInstance(locale, errorCode); - if(U_FAILURE(errorCode)) { - setToBogus(); - return *this; +UnicodeString::toTitle(BreakIterator *iter, const Locale &locale, uint32_t options) { + LocalPointer<BreakIterator> ownedIter; + UErrorCode errorCode = U_ZERO_ERROR; + iter = ustrcase_getTitleBreakIterator(&locale, "", options, iter, ownedIter, errorCode); + if (iter == nullptr) { + setToBogus(); + return *this; } - } - // Because the "this" string is both the source and the destination, - // make a copy of the original source for use by the break iterator. - // See tickets #13127 and #13128 - UnicodeString copyOfInput(*this); - bi->setText(copyOfInput); - caseMap(ustrcase_getCaseLocale(locale.getBaseName()), options, bi, ustrcase_internalToTitle); - if(titleIter==NULL) { - delete bi; - } - return *this; + caseMap(ustrcase_getCaseLocale(locale.getBaseName()), options, iter, ustrcase_internalToTitle); + return *this; } U_NAMESPACE_END |