// chapter number exists, extract it and put the remainder after the colon into range
wxString strChapter = SpanExcluding(chVerse,_T(":"));
#ifdef __WXMAC__
// Kludge because the atoi() function in the MacOS X standard library can't handle Arabic digits
for (size_t imak=0; imak < strChapter.Len(); imak++)
{
wxChar imaCh = strChapter.GetChar(imak);
if (imaCh >= (wchar_t)0x6f0 && imaCh <= (wchar_t)0x6f9)
strChapter.SetChar(imak, imaCh & (wchar_t)0x3f); // zero out the higher bits of these Arabic digits
}
#endif /* __WXMAC__ */
chap = wxAtoi(strChapter);
I have verified that the correct wchars are being given by wxAtoi() to the Mac function atoi() and that an EXC_BAD_ACCESS happens (consistently, every time) in the assembly code inside atoi() -- for which I do not have the source.
We are using Xcode 2.5 on MacOS X.4.11.
Has anyone else run into this problem?
Many thanks,
Graeme