Put digits into an own segment with the title #
Change-Id: I5f3ae179d388c417abd512974df22fd78a699354
diff --git a/android/PhonebookIndex.cpp b/android/PhonebookIndex.cpp
index 57f3bda..8f5e4be 100644
--- a/android/PhonebookIndex.cpp
+++ b/android/PhonebookIndex.cpp
@@ -143,8 +143,15 @@
UChar c = out[0];
- // We are only interested in letters
if (!u_isalpha(c)) {
+ // Digits go into a # section. Everything else goes into the empty section
+ // The unicode function u_isdigit would also identify other characters as digits (arabic),
+ // but if we caught them here we'd risk having the same section before and after alpha-letters
+ // which might break the assumption that each section exists only once
+ if (c >= '0' && c <= '9') {
+ out[0] = '#';
+ return 1;
+ }
return 0;
}