diff options
author | Fredrik Roubert <roubert@google.com> | 2017-04-18 21:34:02 +0200 |
---|---|---|
committer | Fredrik Roubert <roubert@google.com> | 2017-06-21 19:43:12 +0200 |
commit | 0596faeddefbf198de137d5e893708495ab1584c (patch) | |
tree | a15ec3ada94f1d279e9928cb9269d40d2ed0338b /icu4c/source/i18n/zonemeta.cpp | |
parent | dbf1ed8683f38335caccdfb15a0386b77f1c9dde (diff) | |
download | icu-0596faeddefbf198de137d5e893708495ab1584c.tar.gz |
Copy ICU4C 59 release from icu-project.org to aosp/icu59.
These files were exported from the ICU Subversion repository by running
the following command:
svn export \
http://source.icu-project.org/repos/icu/tags/release-59-1/icu4c icu4c
Change-Id: I7391eb92454063d3f7e32753b5d513861b146b72
Diffstat (limited to 'icu4c/source/i18n/zonemeta.cpp')
-rw-r--r-- | icu4c/source/i18n/zonemeta.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/icu4c/source/i18n/zonemeta.cpp b/icu4c/source/i18n/zonemeta.cpp index fdf333c37..84a965780 100644 --- a/icu4c/source/i18n/zonemeta.cpp +++ b/icu4c/source/i18n/zonemeta.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -17,7 +17,7 @@ #include "unicode/ustring.h" #include "unicode/putil.h" #include "unicode/simpletz.h" - +#include "unicode/strenum.h" #include "umutex.h" #include "uvector.h" #include "cmemory.h" @@ -28,6 +28,7 @@ #include "uresimp.h" #include "uhash.h" #include "olsontz.h" +#include "uinvchar.h" static UMutex gZoneMetaLock = U_MUTEX_INITIALIZER; @@ -255,6 +256,12 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) { tzid.extract(utzid, ZID_KEY_MAX + 1, tmpStatus); U_ASSERT(tmpStatus == U_ZERO_ERROR); // we checked the length of tzid already + if (!uprv_isInvariantUString(utzid, -1)) { + // All of known tz IDs are only containing ASCII invariant characters. + status = U_ILLEGAL_ARGUMENT_ERROR; + return NULL; + } + // Check if it was already cached umtx_lock(&gZoneMetaLock); { |