From 52c9e52b5f6612204eae097f41e89e50368477e2 Mon Sep 17 00:00:00 2001 From: Fred Kiefer Date: Sun, 14 Oct 2001 21:34:31 +0000 Subject: [PATCH] In iconv_cstrtoustr() and iconv_ustrtocstr() report if a iconv conversion cannot be found. Also added a type convert to the iconv call, so that the compiler wont report a type mismatch. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11140 72102866-910b-0410-8b05-ffd578937521 --- Source/Unicode.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Unicode.m b/Source/Unicode.m index 90e7a2397..d0aa5e914 100644 --- a/Source/Unicode.m +++ b/Source/Unicode.m @@ -379,10 +379,12 @@ iconv_cstrtoustr(unichar *u2, int size2, const char *s1, int size1, conv = iconv_open(UNICODE_ENC, iconv_stringforencoding(enc)); if (conv == (iconv_t)-1) { + NSLog(@"No iconv for encoding %@ tried to use %s", + GetEncodingName(enc), iconv_stringforencoding(enc)); return 0; } - ret_val = iconv(conv, &s1, &size1, &u1, &usize); + ret_val = iconv(conv, (char**)&s1, &size1, &u1, &usize); // close the converter iconv_close(conv); if (ret_val == -1) @@ -406,10 +408,12 @@ iconv_ustrtocstr(char *s2, int size2, const unichar *u1, int size1, conv = iconv_open(iconv_stringforencoding(enc), UNICODE_ENC); if (conv == (iconv_t)-1) { + NSLog(@"No iconv for encoding %@ tried to use %s", + GetEncodingName(enc), iconv_stringforencoding(enc)); return 0; } - ret_val = iconv(conv, &u2, &usize, &s2, &size2); + ret_val = iconv(conv, (char**)&u2, &usize, &s2, &size2); // close the converter iconv_close(conv); if (ret_val == -1)