From f086fd06591eafd4fb96cdc33ea8fb1b95f18e59 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Thu, 28 Apr 2016 14:03:41 +0300 Subject: [PATCH] lib-charset: Do not use //IGNORE on non-GNU system --- src/lib-charset/test-charset.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib-charset/test-charset.c b/src/lib-charset/test-charset.c index 18da108464..6ba72bb93a 100644 --- a/src/lib-charset/test-charset.c +++ b/src/lib-charset/test-charset.c @@ -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) -- 2.47.3