]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-charset: Do not use //IGNORE on non-GNU system
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 28 Apr 2016 11:03:41 +0000 (14:03 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 28 Apr 2016 12:35:32 +0000 (15:35 +0300)
src/lib-charset/test-charset.c

index 18da108464eca3c6f53468c7ff4856cf04367b0a..6ba72bb93ad1664df556faaa2b3c0d54efc3ffe8 100644 (file)
@@ -105,7 +105,12 @@ static void test_charset_iconv(void)
        }
        /* Use //IGNORE just to force handling to be done by iconv
           instead of our own UTF-8 routines. */
-       test_charset_utf8_common("UTF-8//IGNORE");
+       /* check if //IGNORE is supported by ICONV */
+       if (charset_to_utf8_str("UTF-8//IGNORE", NULL, "", str, &result) < 0)
+               test_charset_utf8_common("UTF-8");
+       else
+               test_charset_utf8_common("UTF-8//IGNORE");
+       test_end();
        test_end();
 }
 static void test_charset_iconv_crashes(void)