From 6c8c62e93c543fd940169da519e6528c47e54717 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sat, 29 Aug 2009 13:53:42 +0200 Subject: fix UTF8-character handling in timer filenames --- HISTORY | 3 +++ HISTORY.DE | 2 ++ epgsearchext.c | 7 ++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/HISTORY b/HISTORY index 6ffaecb..ffec882 100644 --- a/HISTORY +++ b/HISTORY @@ -87,6 +87,9 @@ fixes: - some fixes to compile with gcc-4.4, thanks to firefly@vdrportal for providing a patch - fixed wrong man section of some man pages, thanks to Ville Skyttä for providing a patch - some fixes regarding libtre includes, thanks to Ville Skyttä for providing a patch +- fix UTF8-character handling in timer file names, thanks to Rolf Ahrenberg for providing + a patch + 2008-04-29: Version 0.9.24 new: diff --git a/HISTORY.DE b/HISTORY.DE index 7495535..b701d43 100644 --- a/HISTORY.DE +++ b/HISTORY.DE @@ -91,6 +91,8 @@ fixes: Patch. - Falsche Man-Sektion einiger Man-Pages korrigiert, Danke an Ville Skyttä für den Patch. - Einige Korrekturen bzgl. libtre-Includes, Danke an Ville Skyttä für den Patch. +- Korrektur beim UTF8-Zeichensatz-Handling bei Timer-Filenamen, Danke an Rolf Ahrenberg für + den Patch. 2008-04-29: Version 0.9.24 diff --git a/epgsearchext.c b/epgsearchext.c index 32e9c40..37be75a 100644 --- a/epgsearchext.c +++ b/epgsearchext.c @@ -628,15 +628,16 @@ char* cSearchExt::BuildFile(const cEvent* pEvent) const return file; const char *Subtitle = pEvent ? pEvent->ShortText() : NULL; - char SubtitleBuffer[MAX_SUBTITLE_LENGTH]; + char SubtitleBuffer[Utf8BufSize(MAX_SUBTITLE_LENGTH)]; if (isempty(Subtitle)) { sprintf(SubtitleBuffer, "%s-%s", GETDATESTRING(pEvent), GETTIMESTRING(pEvent)); Subtitle = SubtitleBuffer; } - else if (strlen(Subtitle) > MAX_SUBTITLE_LENGTH) + else if (Utf8StrLen(Subtitle) > MAX_SUBTITLE_LENGTH) { - strn0cpy(SubtitleBuffer, Subtitle, MAX_SUBTITLE_LENGTH); + Utf8Strn0Cpy(SubtitleBuffer, Subtitle, sizeof(SubtitleBuffer)); + SubtitleBuffer[Utf8SymChars(SubtitleBuffer, MAX_SUBTITLE_LENGTH)] = 0; Subtitle = SubtitleBuffer; } -- cgit v1.2.3