find_package(CURL ${CURL_MINIMUM} REQUIRED)
-if(UNIX)
- find_package(ICONV REQUIRED)
-endif()
+find_package(ICONV)
if(WITH_CRYPTO STREQUAL "AUTO" OR WITH_CRYPTO STREQUAL "openssl")
tr_get_required_flag(WITH_CRYPTO OPENSSL_IS_REQUIRED)
getmntent
getpagesize
htonll
- iconv_open
localtime_r
memmem
mkdtemp
endif()
endforeach()
+if(ICONV_FOUND)
+ add_definitions(-DHAVE_ICONV_OPEN)
+endif()
+
# if(MINGW)
# check_function_exists(__mingw_printf HAVE_MINGW_PRINTF)
# if(HAVE_MINGW_PRINTF)
"-DHAVE_LIBGEN",
"-DHAVE_STRCASECMP",
"-DHAVE_ZLIB",
+ "-DHAVE_ICONV",
);
- OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
PRODUCT_NAME = transmission;
};
name = Debug;
"-DHAVE_LIBGEN",
"-DHAVE_STRCASECMP",
"-DHAVE_ZLIB",
+ "-DHAVE_ICONV",
);
PRODUCT_NAME = transmission;
};
"-DHAVE_LIBGEN",
"-DHAVE_STRCASECMP",
"-DHAVE_ZLIB",
+ "-DHAVE_ICONV",
);
PRODUCT_NAME = transmission;
};
AC_HEADER_TIME
AC_CHECK_HEADERS([stdbool.h xlocale.h])
-AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename canonicalize_file_name strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp uselocale _configthreadlocale])
+AC_CHECK_FUNCS([iconv pread pwrite lrintf strlcpy daemon dirname basename canonicalize_file_name strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp uselocale _configthreadlocale])
AC_PROG_INSTALL
AC_PROG_MAKE_SET
ACX_PTHREAD
in = "\xF4\x00\x81\x82";
out = tr_utf8clean (in, 4);
check (out != NULL);
- check_streq ("?", out);
+ check ((strlen (out) == 1) || (strlen (out) == 2));
check (tr_utf8_validate (out, TR_BAD_SIZE, NULL));
tr_free (out);
in = "\xF4\x33\x81\x82";
out = tr_utf8clean (in, 4);
check (out != NULL);
- check_streq ("?3??", out);
+ check ((strlen (out) == 4) || (strlen (out) == 7));
check (tr_utf8_validate (out, TR_BAD_SIZE, NULL));
tr_free (out);
#if defined (XCODE_BUILD)
#define HAVE_GETPAGESIZE
- #define HAVE_ICONV_OPEN
#define HAVE_VALLOC
#endif
#include <unistd.h> /* getpagesize () */
#endif
-#ifdef HAVE_ICONV_OPEN
+#ifdef HAVE_ICONV
#include <iconv.h>
#endif
{
char * ret = NULL;
-#ifdef HAVE_ICONV_OPEN
+#ifdef HAVE_ICONV
int i;
const char * encodings[] = { "CURRENT", "ISO-8859-15" };
const int encoding_count = sizeof (encodings) / sizeof (encodings[1]);