• 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
Problem with exec and accentuated characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with exec and accentuated characters


  • Subject: Problem with exec and accentuated characters
  • From: Arthur VIGAN <email@hidden>
  • Date: Sat, 26 Feb 2005 01:43:48 +0100

Hi,

I have a problem with the UNIX execl() function and the accentuated characters. My code is mainly based on CoreFoundation, but I think the problem would be the same using Cocoa and NSString. I have the following code that works fine with paths containing no accentuated characters:

        CFIndex     length;
        char        	*app;
        Boolean     result=false;

        length=CFStringGetLength(toolStringRef);
        app = (char*)malloc((length+1)*sizeof(char));
        result = CFStringGetCString(toolStringRef,
                                    app,
                                    length+1,
                                    kCFStringEncodingMacRoman);

            if(fork() == 0)
                execl(app,app,NULL);

The problems comes when the CFStringRef "toolStringRef" contains accentuated characters: the C "app" string does not contain proper characters, so the call to execl() does nothing and returns an error.

Does someone know any solution to this problem?

Thanks in advance,

 -- Arthur;

PS: I am sorry if this concerns only CoreFoundation, but there is no specific list for that!

--
Arthur VIGAN
<email@hidden>


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Problem with exec and accentuated characters
      • From: Chris Hanson <email@hidden>
    • Re: Problem with exec and accentuated characters
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: affine transformation of bitmap images
  • Next by Date: NSAffineTransforms not working as expected?
  • Previous by thread: NSOpenPanel with a preview
  • Next by thread: Re: Problem with exec and accentuated characters
  • Index(es):
    • Date
    • Thread