summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/values/strings.xml5
-rw-r--r--src/org/madore/android/unicodeMap/UnicodeMapActivity.java3
2 files changed, 7 insertions, 1 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index acdc3e0..8c73c38 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -16,7 +16,10 @@
<string name="menu_search">Search</string>
<string name="search_title">Search in character names</string>
<string name="search_button">Search</string>
- <string name="search_hint">Case is insensitive and matches whole string; use a % sign as wildcard (e.g.: "latin%letter r%")</string>
+ <string name="search_hint">Case is insensitive and matches whole
+ string; use a * sign as wildcard (e.g.:
+ "latin*letter r*"); CJK ideographs and Hangul syllables cannot
+ be searched</string>
<string name="search_results">search results</string>
<string name="list_too_long">Only %d first results shown</string>
<string name="menu_about">About</string>
diff --git a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
index 2795c28..5a2622a 100644
--- a/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
+++ b/src/org/madore/android/unicodeMap/UnicodeMapActivity.java
@@ -362,6 +362,9 @@ public final class UnicodeMapActivity extends ListActivity {
final static int searchLimit = 1000;
protected void doSearch(String s) {
+ s = s.replaceAll("\\*", "%");
+ s = s.replaceAll("^\\s*", "");
+ s = s.replaceAll("\\s*$", "");
Display newDisp = new SearchDisplay(getResources().getString(R.string.search_results),
s, searchLimit);
saveDisplay();