diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-24 21:19:29 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-01-24 21:19:29 +0100 |
commit | 5ee5ea4f0a6027e0261e4ee769bedb0e598c41de (patch) | |
tree | 675298a99462f802c04db15fc32527b8d74b52cd /csid.cpp | |
parent | aa4832661a52fbcdccafae62fccb9e4901777f3d (diff) |
iconv fixes for bsd compatibility
Diffstat (limited to 'csid.cpp')
-rw-r--r-- | csid.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -18,6 +18,7 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#define LIBICONV_PLUG #include <iconv.h> #ifdef HAVE_CONFIG_H # include <config.h> @@ -442,9 +443,9 @@ convstr (const char* str) { int sz = strlen (str); static char out[2048]; const char *enc = "iso8859-1"; - iconv_t cd = iconv_open ("utf8", enc); - if (!cd) { - trace ("unknown encoding: %s\n", enc); + iconv_t cd = iconv_open ("utf-8", enc); + if (cd == (iconv_t)-1) { + trace ("can't convert from %s to utf8\n", enc); return NULL; } else { |