r4184 - in vdr/vdr/trunk/debian: . patches

Thomas Günther tom-guest at alioth.debian.org
Sat Feb 24 23:06:29 CET 2007


Author: tom-guest
Date: 2007-02-24 23:06:29 +0100 (Sat, 24 Feb 2007)
New Revision: 4184

Added:
   vdr/vdr/trunk/debian/patches/17_epg-conv-iso6937.dpatch
Modified:
   vdr/vdr/trunk/debian/changelog
   vdr/vdr/trunk/debian/patches/00list
   vdr/vdr/trunk/debian/patches/patchtest
Log:
Added 17_epg-conv-iso6937.dpatch

Modified: vdr/vdr/trunk/debian/changelog
===================================================================
--- vdr/vdr/trunk/debian/changelog	2007-02-23 23:22:46 UTC (rev 4183)
+++ vdr/vdr/trunk/debian/changelog	2007-02-24 22:06:29 UTC (rev 4184)
@@ -18,6 +18,8 @@
   [ Thomas Günther ]
   * Upgraded make-special-vdr.sh to version 0.4 (fixed detection of *.vdr files
     in burn plugin, updated for new vompserver release)
+  * Added 17_epg-conv-iso6937.dpatch (convert EPG of UPC Direct / HBO
+    from iso6937 to iso8859-2) (closes: #384836)
 
  -- Tobias Grimm <tg at e-tobi.net>  Sat,  3 Feb 2007 02:32:43 +0100
 

Modified: vdr/vdr/trunk/debian/patches/00list
===================================================================
--- vdr/vdr/trunk/debian/patches/00list	2007-02-23 23:22:46 UTC (rev 4183)
+++ vdr/vdr/trunk/debian/patches/00list	2007-02-24 22:06:29 UTC (rev 4184)
@@ -9,6 +9,7 @@
 14_cap-memsize
 15_dvbplayer
 16_channels.conf.terr-fix
+17_epg-conv-iso6937
 
 # Patch collection (replaces enAIO).
 # opt-20_liemikuutio

Added: vdr/vdr/trunk/debian/patches/17_epg-conv-iso6937.dpatch
===================================================================
--- vdr/vdr/trunk/debian/patches/17_epg-conv-iso6937.dpatch	2007-02-23 23:22:46 UTC (rev 4183)
+++ vdr/vdr/trunk/debian/patches/17_epg-conv-iso6937.dpatch	2007-02-24 22:06:29 UTC (rev 4184)
@@ -0,0 +1,51 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 17_epg-conv-iso6937.dpatch by Thomas Günther <tom at toms-cafe.de>
+## http://toms-cafe.de/vdr/download/vdr-epg-conv-iso6937-1.4.5.diff
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Convert EPG of UPC Direct / HBO from iso6937 to iso8859-2.
+
+ at DPATCH@
+--- vdr-1.4.5/epg.c
++++ vdr-1.4.5/epg.c
+@@ -15,6 +15,28 @@
+ #include <time.h>
+ #include "libsi/si.h"
+ #include "timers.h"
++#include <iconv.h>
++static void ConvertFromISO6937(char *text)
++{
++  // Convert text from iso6937 to iso8859-2 (only if text contains one of 0xC1..0xC8, 0xCA, 0xCB, 0xCD..0xCF)
++  if (!text || strcspn(text, "\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xCA\xCB\xCD\xCE\xCF") == strlen(text)) return;
++  char *buffer = strdup(text);
++  iconv_t ic = iconv_open("iso8859-2", "iso6937");
++  if (ic >= 0) {
++     char *in = text;
++     char *out = buffer;
++     size_t inbytesleft = strlen(text);
++     size_t outbytesleft = inbytesleft;
++     if (iconv(ic, &in, &inbytesleft, &out, &outbytesleft) != (size_t)(-1)) {
++        *out = 0;
++        strcpy(text, buffer);
++        }
++     else
++        dsyslog("Converting from iso6937 failed at: %s", in);
++     iconv_close(ic);
++     }
++  free(buffer);
++}
+ 
+ #define RUNNINGSTATUSTIMEOUT 30 // seconds before the running status is considered unknown
+ 
+@@ -641,6 +663,11 @@
+   strreplace(shortText, '\x87', ' ');
+   strreplace(description, '\x86', ' ');
+   strreplace(description, '\x87', ' ');
++
++  // Check for iso6937 characters in EPG and convert them if possible
++  ConvertFromISO6937(title);
++  ConvertFromISO6937(shortText);
++  ConvertFromISO6937(description);
+ }
+ 
+ // --- cSchedule -------------------------------------------------------------

Modified: vdr/vdr/trunk/debian/patches/patchtest
===================================================================
--- vdr/vdr/trunk/debian/patches/patchtest	2007-02-23 23:22:46 UTC (rev 4183)
+++ vdr/vdr/trunk/debian/patches/patchtest	2007-02-24 22:06:29 UTC (rev 4184)
@@ -14,7 +14,7 @@
     14_cap-memsize \
     15_dvbplayer \
     16_channels.conf.terr-fix \
-    81_Make_config "
+    17_epg-conv-iso6937"
 multipatch="$standard \
     opt-20_liemikuutio \
     opt-24_jumpplay \




More information about the pkg-vdr-dvb-changes mailing list