]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Remove (more or less) unused character conversion functions.
authorAndreas Öman <andreas@lonelycoder.com>
Tue, 14 Oct 2008 18:56:15 +0000 (18:56 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Tue, 14 Oct 2008 18:56:15 +0000 (18:56 +0000)
We're true UTF-8 now.

channels.c
main.c
tvhead.h

index fe939bf44f6ee5038f0edf7df88eab5c7997574b..1a2f9caf2a7e41f524deae5071e31840c6018e7e 100644 (file)
@@ -132,7 +132,7 @@ channel_set_name(channel_t *ch, const char *name)
   l = strlen(name);
   ch->ch_sname = cp = malloc(l + 1);
 
-  n2 = utf8toprintable(name);
+  n2 = strdup(name);
 
   for(i = 0; i < strlen(n2); i++) {
     c = tolower(n2[i]);
diff --git a/main.c b/main.c
index 11321dabde5b643644cf6cac636fbe48aac5b202..f84ffcb950cbff8f66fa82ca09ce64ca1bc8e468 100644 (file)
--- a/main.c
+++ b/main.c
@@ -341,73 +341,6 @@ main(int argc, char **argv)
 
 }
 
-
-
-static char *
-convert_to(const char *in, const char *target_encoding)
-{
-  iconv_t ic;
-  size_t inlen, outlen, alloced, pos;
-  char *out, *start;
-  int r;
-
-  inlen = strlen(in);
-  alloced = 100;
-  outlen = alloced;
-
-  ic = iconv_open(target_encoding, "UTF8");
-  if(ic == NULL)
-    return NULL;
-
-  out = start = malloc(alloced + 1);
-
-  while(inlen > 0) {
-    r = iconv(ic, (char **)&in, &inlen, &out, &outlen);
-
-    if(r == (size_t) -1) {
-      if(errno == EILSEQ) {
-       in++;
-       inlen--;
-       continue;
-      }
-
-      if(errno == E2BIG) {
-       pos = alloced - outlen;
-       alloced *= 2;
-       start = realloc(start, alloced + 1);
-       out = start + pos;
-       outlen = alloced - pos;
-       continue;
-      }
-      break;
-    }
-  }
-
-  iconv_close(ic);
-  pos = alloced - outlen;
-  start[pos] = 0;
-  return start;
-}
-
-
-
-
-
-char *
-utf8toprintable(const char *in) 
-{
-  return convert_to(in, "ISO_8859-1");
-}
-
-char *
-utf8tofilename(const char *in) 
-{
-  return convert_to(in, "LATIN1");
-}
-
-
-
-
 /**
  *
  */
index 9b1fc0c97302c795e12d4f30645befaaa0acc177..556f25fa9fadb360e91b8cd3f7f9c4d16d154d13 100644 (file)
--- a/tvhead.h
+++ b/tvhead.h
@@ -832,8 +832,6 @@ typedef struct th_muxstream {
 #endif
 
 
-char *utf8toprintable(const char *in);
-char *utf8tofilename(const char *in);
 const char *streaming_component_type2txt(streaming_component_type_t s);
 
 static inline unsigned int tvh_strhash(const char *s, unsigned int mod)