From 448d945fdd57f777962f183ded20d84699d23ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Tue, 14 Oct 2008 18:56:15 +0000 Subject: [PATCH] Remove (more or less) unused character conversion functions. We're true UTF-8 now. --- channels.c | 2 +- main.c | 67 ------------------------------------------------------ tvhead.h | 2 -- 3 files changed, 1 insertion(+), 70 deletions(-) diff --git a/channels.c b/channels.c index fe939bf4..1a2f9caf 100644 --- a/channels.c +++ b/channels.c @@ -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 11321dab..f84ffcb9 100644 --- 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"); -} - - - - /** * */ diff --git a/tvhead.h b/tvhead.h index 9b1fc0c9..556f25fa 100644 --- 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)