From: Andreas Ă–man Date: Tue, 14 Oct 2008 18:56:15 +0000 (+0000) Subject: Remove (more or less) unused character conversion functions. X-Git-Tag: 2.12~765 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=448d945fdd57f777962f183ded20d84699d23ec2;p=thirdparty%2Ftvheadend.git Remove (more or less) unused character conversion functions. We're true UTF-8 now. --- diff --git a/channels.c b/channels.c index fe939bf44..1a2f9caf2 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 11321dabd..f84ffcb95 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 9b1fc0c97..556f25fa9 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)