Post

Replies

Boosts

Views

Activity

libiconv crashes on iOS 18, iOS 16 beta and macOS 15 for certain combinations of strings and encodings
When converting a string using libiconv, for certain combinations of strings and encodings, sometimes iconv() crashes Assertion failed: (tmpin - *in <= *inbytes), function _citrus_iconv_std_iconv_convert, file citrus_iconv_std.c, line 1916. This means that libiconv is a debug build since it asserts and also that it doesn't handles certain characters, it should not crash but return some error code. I've reported this problem twice to Apple, nothing happens. FB17715360 and FB17567155 Below is a simple code snippet that illustrates the problem: #include <iconv.h> #import <Foundation/Foundation.h> void TestLibIconv() { NSLog(@"Convert a string from some encoding to some other"); NSLog(@"The in string may have some unknown encoding"); const char *inEnc = "SHIFT_JIS"; // Japanese //const char *inEnc = "CP1252"; // works const char *outEnc = "UTF-8"; NSLog(@"inEnc %s outEnc %s", inEnc, outEnc); iconv_t cd = iconv_open(outEnc, inEnc); if (cd != (iconv_t) -1) { #if 1 // works when this flag isn't set int on = 1; // allow illegal byte sequence iconvctl(cd, ICONV_SET_DISCARD_ILSEQ, &on); #endif const size_t m_kMaxOutChars = 200; char outBuffer[m_kMaxOutChars+1]; memset(outBuffer, 0, sizeof(outBuffer)); char inStr[] = "\"\xe5\""; // crashes - the '\"' character seems to be the problem size_t inbytesleft = strlen(inStr); size_t outbytesleft = m_kMaxOutChars; char *pInBuf = inStr; char *pOutBuf = outBuffer; size_t retVal = iconv(cd, &pInBuf, &inbytesleft, &pOutBuf, &outbytesleft); NSLog(@"iconv() returns %ld", retVal); NSLog(@"outBuffer %s", outBuffer); iconv_close(cd); } }
2
0
140
3w
Auto-Renew Membership
I have ticked the "Auto-Renew Membership" check box but every time I log in to iTunes Connect, I'm greated with:Renew Your Apple Developer Program MembershipIf you do not renew your membership before Sep 28, 2016, your apps will no longer be available on the App Store.Previously I paid every year but this time I selected "Auto-Renew Membership".Should I be worried about the message?Thanks
10
0
8.2k
Sep ’16