summaryrefslogtreecommitdiff
path: root/csid.cpp
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-24 21:19:29 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-24 21:19:29 +0100
commit5ee5ea4f0a6027e0261e4ee769bedb0e598c41de (patch)
tree675298a99462f802c04db15fc32527b8d74b52cd /csid.cpp
parentaa4832661a52fbcdccafae62fccb9e4901777f3d (diff)
iconv fixes for bsd compatibility
Diffstat (limited to 'csid.cpp')
-rw-r--r--csid.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/csid.cpp b/csid.cpp
index 8048ff68..e6bb611b 100644
--- a/csid.cpp
+++ b/csid.cpp
@@ -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 {