]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/unicode/iconv.c
libiconv warning fix
[netatalk.git] / libatalk / unicode / iconv.c
index 6411c9030ef8fca3827f704ee7177c6af10e855c..48f903bc7e3482225ca3cfeaf06c2b4e8de2e4aa 100644 (file)
 #include <unistd.h>
 #include <string.h>
 #include <ctype.h>
+#include <errno.h>
 #include <sys/param.h>
 #include <sys/stat.h>
-#include <atalk/logger.h>
-#include <errno.h>
-
-#include <netatalk/endian.h>
-#include <atalk/unicode.h>
-
 #ifdef HAVE_USABLE_ICONV
 #include <iconv.h>
 #endif
+
+#include <netatalk/endian.h>
+#include <atalk/unicode.h>
+#include <atalk/logger.h>
 #include "byteorder.h"
 
 
@@ -92,7 +91,7 @@ struct charset_functions charset_ucs2 =
         0,
         iconv_copy,
         iconv_copy,
-        CHARSET_WIDECHAR
+        CHARSET_WIDECHAR | CHARSET_PRECOMPOSED
 };
 
 struct charset_functions charset_ascii =
@@ -206,7 +205,7 @@ static size_t sys_iconv(void *cd,
 {
 #ifdef HAVE_USABLE_ICONV
        size_t ret = iconv((iconv_t)cd, 
-                          inbuf, inbytesleft, 
+                          (ICONV_CONST char**)inbuf, inbytesleft, 
                           outbuf, outbytesleft);
        if (ret == (size_t)-1) iconv(cd, NULL, NULL, NULL, NULL);
        return ret;
@@ -297,14 +296,12 @@ atalk_iconv_t atalk_iconv_open(const char *tocode, const char *fromcode)
 
        /* check if we can use iconv for this conversion */
 #ifdef HAVE_USABLE_ICONV
-       LOG (log_debug, logtype_default, "Trying %s/%s", UCS2ICONV, fromcode);
        if (!ret->pull) {
                ret->cd_pull = iconv_open(UCS2ICONV, fromcode);
                if (ret->cd_pull != (iconv_t)-1)
                        ret->pull = sys_iconv;
        }
 
-       LOG (log_debug, logtype_default, "Trying %s/%s", tocode, UCS2ICONV);
        if (!ret->push) {
                ret->cd_push = iconv_open(tocode, UCS2ICONV);
                if (ret->cd_push != (iconv_t)-1)