Re: Non-ASCII NSTask arguments
Re: Non-ASCII NSTask arguments
- Subject: Re: Non-ASCII NSTask arguments
- From: Nir Soffer <email@hidden>
- Date: Fri, 25 Aug 2006 02:02:39 +0300
On Aug 24, 2006, at 7:09 PM, Andrew Farmer wrote:
You can just send the unicode string as is, It seems that NSTask
is doing the right thing with it.
NSArray *args = [NSArray arrayWithObjects:
@"-l",
@"-v",
[NSString stringWithUTF8String:"/Path/To/שלום"], nil];
[NSTask launchedTaskWithLaunchPath:@"/bin/ls" arguments:args];
That doesn't really prove anything, as the C compiler isn't 8-bit
safe.
It prove that it works :-) at least with the common setup.
The real issue here
is probably that you're not using -[NSString
fileSystemRepresentation], which will
return a specific encoding of the file name which is equal to the
one used on disk.
It seems you can't control the encoding - the docs does not say
anything about it, and I guess that internally NSTask encode all the
arguments using fileSystemRepresetation.
Best Regards,
Nir Soffer
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
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