diff options
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | HISTORY.DE | 2 | ||||
-rw-r--r-- | epgsearchtools.c | 22 |
3 files changed, 24 insertions, 4 deletions
@@ -139,7 +139,9 @@ fixes: Teemu Rantanen for providing a patch. - fixed the service interface for switchtimers because of wrong parameter handling, thanks to gnapheus@vdrportal for reporting. - +- fixed case insensitve searching when Utf-8 characters are involved, thanks to Ville + Skyttä for reporting + 2008-04-29: Version 0.9.24 new: @@ -147,6 +147,8 @@ fixes: Teemu Rantanen für einen Patch. - Service-Schnittstelle für Umschalttimer wegen falschem Parameterhandling korrigiert, Danke an gnapheus@vdrportal für den Hinweis. +- Korrektur der Suche ohne Unterscheidung von Groß-/Kleinschreibung in Verbindung mit + Utf-8-Zeichen, danke an Ville Skyttä für den Hinweis. 2008-04-29: Version 0.9.24 diff --git a/epgsearchtools.c b/epgsearchtools.c index c58ccc0..71a83a1 100644 --- a/epgsearchtools.c +++ b/epgsearchtools.c @@ -53,6 +53,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch #endif const char AllowedChars[] = trNOOP("$ abcdefghijklmnopqrstuvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&"); +extern bool isUTF8; int CompareEventTime(const void *p1, const void *p2) { @@ -401,9 +402,24 @@ bool MatchesSearchMode(const char* szTest, const char* searchText, int mode, con void ToLower(char* szText) { if (!szText) - return; - for (int loop = 0; szText[loop] !=0; loop++) - szText[loop] = tolower(szText[loop]); + return; + + if (!isUTF8) + { + for (int loop = 0; szText[loop] !=0; loop++) + szText[loop] = tolower(szText[loop]); + return; + } + else + { + int length = strlen(szText)+1; + uint* valueUtf8 = new uint[length]; + int lengthUtf8 = Utf8ToArray(szText, valueUtf8, length); + for(int i=0; i<lengthUtf8; i++) + valueUtf8[i] = Utf8to(lower, valueUtf8[i]); + Utf8FromArray(valueUtf8, szText, length); + delete [] valueUtf8; + } } char* GetExtEPGValue(const cEvent* e, cSearchExtCat* SearchExtCat) |