diff options
Diffstat (limited to 'sound_detector/iconv.c')
-rw-r--r-- | sound_detector/iconv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound_detector/iconv.c b/sound_detector/iconv.c index 1601bd1..6d488fc 100644 --- a/sound_detector/iconv.c +++ b/sound_detector/iconv.c @@ -22,7 +22,7 @@ #include <stdlib.h> #include <iconv.h> -char *to_utf8(const char *koi8r) +char *change_charset(const char *source) { iconv_t id = iconv_open("CP866", "WINDOWS-1251"); if((long)id == -1) @@ -30,12 +30,12 @@ char *to_utf8(const char *koi8r) printf("failed to create iconv descriptor with error: %s\n", strerror(errno)); return NULL; } - int len = strlen(koi8r), outlen = 0; + int len = strlen(source), outlen = 0; len++; outlen = len * 2; char *outbuf = (char*)malloc(len * 2), *op, *ip; op = outbuf; - ip = koi8r; + ip = source; int enc_len = iconv(id, &ip, &len, &op, &outlen); if(enc_len == -1) { |