Reorder reverse caps characters table for string lower case conversion
The binary search algorithm used to lookup character codes in the table
relies that the data must be ordered. This fixes `to_lower()` string
method to convert upper case to lower case properly, so that the
algorithm doesn't terminate prematurely.
Co-authored-by: AndreevAndrei (avandrei) <avandrei@MacBookAAV.local>
(cherry picked from commit 34e6737413
)
This commit is contained in:
parent
f673bc1e3d
commit
4574894e43
1332
core/ucaps.h
1332
core/ucaps.h
File diff suppressed because it is too large
Load Diff
|
@ -1053,6 +1053,19 @@ bool test_33() {
|
||||||
return empty.parse_utf8(NULL, -1) == true;
|
return empty.parse_utf8(NULL, -1) == true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool test_34() {
|
||||||
|
OS::get_singleton()->print("\n\nTest 34: Cyrillic to_lower()\n");
|
||||||
|
|
||||||
|
String upper = L"АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ";
|
||||||
|
String lower = L"абвгдеёжзийклмнопрстуфхцчшщъыьэюя";
|
||||||
|
|
||||||
|
String test = upper.to_lower();
|
||||||
|
|
||||||
|
bool state = test == lower;
|
||||||
|
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
typedef bool (*TestFunc)(void);
|
typedef bool (*TestFunc)(void);
|
||||||
|
|
||||||
TestFunc test_funcs[] = {
|
TestFunc test_funcs[] = {
|
||||||
|
@ -1090,6 +1103,7 @@ TestFunc test_funcs[] = {
|
||||||
test_31,
|
test_31,
|
||||||
test_32,
|
test_32,
|
||||||
test_33,
|
test_33,
|
||||||
|
test_34,
|
||||||
0
|
0
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue