Update ICU to 54.1 step 1
1. Replace 'src/' with a fresh copy of ICU 54.1 from the upstream.
2. Remove unncessary files/directories
3. Update the source/header file lists in icu.gypi and icu.gyp
4. Update README.chromium to warn that the ICU head is not usable for
building Chromium/Blink/v8,yet.
BUG=428145
TEST=None
Review URL: https://codereview.chromium.org/845603002
diff --git a/source/common/brkiter.cpp b/source/common/brkiter.cpp
index adbfd65..a4e4466 100644
--- a/source/common/brkiter.cpp
+++ b/source/common/brkiter.cpp
@@ -1,10 +1,10 @@
/*
*******************************************************************************
-* Copyright (C) 1997-2013, International Business Machines Corporation and
+* Copyright (C) 1997-2014, International Business Machines Corporation and
* others. All Rights Reserved.
*******************************************************************************
*
-* File TXTBDRY.CPP
+* File brkiter.cpp
*
* Modification History:
*
@@ -35,6 +35,7 @@
#include "uresimp.h"
#include "uassert.h"
#include "ubrkimpl.h"
+#include "charstr.h"
// *****************************************************************************
// class BreakIterator
@@ -52,7 +53,7 @@
{
char fnbuff[256];
char ext[4]={'\0'};
- char actualLocale[ULOC_FULLNAME_CAPACITY];
+ CharString actualLocale;
int32_t size;
const UChar* brkfname = NULL;
UResourceBundle brkRulesStack;
@@ -93,9 +94,7 @@
// Use the string if we found it
if (U_SUCCESS(status) && brkfname) {
- uprv_strncpy(actualLocale,
- ures_getLocaleInternal(brkName, &status),
- sizeof(actualLocale)/sizeof(actualLocale[0]));
+ actualLocale.append(ures_getLocaleInternal(brkName, &status), -1, status);
UChar* extStart=u_strchr(brkfname, 0x002e);
int len = 0;
@@ -123,7 +122,8 @@
// If there is a result, set the valid locale and actual locale, and the kind
if (U_SUCCESS(status) && result != NULL) {
U_LOCALE_BASED(locBased, *(BreakIterator*)result);
- locBased.setLocaleIDs(ures_getLocaleByType(b, ULOC_VALID_LOCALE, &status), actualLocale);
+ locBased.setLocaleIDs(ures_getLocaleByType(b, ULOC_VALID_LOCALE, &status),
+ actualLocale.data());
result->setBreakType(kind);
}
@@ -461,6 +461,11 @@
return 1;
}
+BreakIterator::BreakIterator (const Locale& valid, const Locale& actual) {
+ U_LOCALE_BASED(locBased, (*this));
+ locBased.setLocaleIDs(valid, actual);
+}
+
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_BREAK_ITERATION */