aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/icu/common/ucase.cpp
diff options
context:
space:
mode:
authorromankoshelev <romankoshelev@yandex-team.com>2023-08-09 20:07:20 +0300
committerromankoshelev <romankoshelev@yandex-team.com>2023-08-09 20:59:13 +0300
commitfd82fb12fb45e71a02c628e45b12c50c0dd0d308 (patch)
treef582b79f9002ab1d083e9acda600dfb3551c47b6 /contrib/libs/icu/common/ucase.cpp
parentbf862ddf5c6178e1bb5e4fb3f7c61015deebe284 (diff)
downloadydb-fd82fb12fb45e71a02c628e45b12c50c0dd0d308.tar.gz
Update ICU to 70.1
Diffstat (limited to 'contrib/libs/icu/common/ucase.cpp')
-rw-r--r--contrib/libs/icu/common/ucase.cpp40
1 files changed, 38 insertions, 2 deletions
diff --git a/contrib/libs/icu/common/ucase.cpp b/contrib/libs/icu/common/ucase.cpp
index 4ec25a27a5..4aa856507a 100644
--- a/contrib/libs/icu/common/ucase.cpp
+++ b/contrib/libs/icu/common/ucase.cpp
@@ -351,7 +351,7 @@ strcmpMax(const UChar *s, int32_t length, const UChar *t, int32_t max) {
if(max==0 || *t==0) {
return 0; /* equal to length of both strings */
} else {
- return -max; /* return lengh difference */
+ return -max; /* return length difference */
}
}
@@ -681,7 +681,7 @@ ucase_isCaseSensitive(UChar32 c) {
* - In [CoreProps], C has one of the properties Uppercase, or Lowercase
* - Given D = NFD(C), then it is not the case that:
* D = UCD_lower(D) = UCD_upper(D) = UCD_title(D)
- * (This third criterium does not add any characters to the list
+ * (This third criterion does not add any characters to the list
* for Unicode 3.2. Ignored.)
*
* D2. A character C is defined to be case-ignorable
@@ -707,6 +707,7 @@ ucase_isCaseSensitive(UChar32 c) {
#define is_r(c) ((c)=='r' || (c)=='R')
#define is_t(c) ((c)=='t' || (c)=='T')
#define is_u(c) ((c)=='u' || (c)=='U')
+#define is_y(c) ((c)=='y' || (c)=='Y')
#define is_z(c) ((c)=='z' || (c)=='Z')
/* separator? */
@@ -804,6 +805,18 @@ ucase_getCaseLocale(const char *locale) {
return UCASE_LOC_DUTCH;
}
}
+ } else if(c=='h') {
+ /* hy or hye? *not* hyw */
+ c=*locale++;
+ if(is_y(c)) {
+ c=*locale++;
+ if(is_e(c)) {
+ c=*locale;
+ }
+ if(is_sep(c)) {
+ return UCASE_LOC_ARMENIAN;
+ }
+ }
}
} else {
// uppercase c
@@ -868,6 +881,18 @@ ucase_getCaseLocale(const char *locale) {
return UCASE_LOC_DUTCH;
}
}
+ } else if(c=='H') {
+ /* hy or hye? *not* hyw */
+ c=*locale++;
+ if(is_y(c)) {
+ c=*locale++;
+ if(is_e(c)) {
+ c=*locale;
+ }
+ if(is_sep(c)) {
+ return UCASE_LOC_ARMENIAN;
+ }
+ }
}
}
return UCASE_LOC_ROOT;
@@ -1229,6 +1254,17 @@ toUpperOrTitle(UChar32 c,
*/
*pString=nullptr;
return 0; /* remove the dot (continue without output) */
+ } else if(c==0x0587) {
+ // See ICU-13416:
+ // և ligature ech-yiwn
+ // uppercases to ԵՒ=ech+yiwn by default and in Western Armenian,
+ // but to ԵՎ=ech+vew in Eastern Armenian.
+ if(loc==UCASE_LOC_ARMENIAN) {
+ *pString=upperNotTitle ? u"ԵՎ" : u"Եվ";
+ } else {
+ *pString=upperNotTitle ? u"ԵՒ" : u"Եւ";
+ }
+ return 2;
} else {
/* no known conditional special case mapping, use a normal mapping */
}