• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
atoi() with wchar Arabic Digits
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

atoi() with wchar Arabic Digits


  • Subject: atoi() with wchar Arabic Digits
  • From: Graeme Costin <email@hidden>
  • Date: Thu, 22 Oct 2009 09:39:12 +1100

Our Unicode wxWidgets app crashes with EXC_BAD_ACCESS  when Eastern Arabic Digits in the range 0x6f0 to 0x6f9 occur in the data and we are trying to get an integer from the digit string.

I have concluded that wxMac 2.8.9 is OK but that the MacOS X atoi() library function can't handle Arabic digits. The following work around gets our app going OK.

    // 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

Costin Computing Services
PO Box 1053
Artarmon  NSW  2064
Ph: 02 9417 4835
Mo: 0416 354 234
Em: email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: atoi() with wchar Arabic Digits
      • From: Dmitry Markman <email@hidden>
  • Prev by Date: Re: [boost] linking on OSX
  • Next by Date: Re: Xcode Project Find Searches Only Open Files
  • Previous by thread: Re: Xcode relative path for Makefile builds
  • Next by thread: Re: atoi() with wchar Arabic Digits
  • Index(es):
    • Date
    • Thread