Problem with exec and accentuated characters
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