Skip navigation.
 
mlRe: Non-ASCII NSTask arguments
FROM : Andrew Farmer
DATE : Thu Aug 24 18:09:01 2006

On 24 Aug 06, at 04:09, Nir Soffer 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.

The real question here, though, isn't "how do you pass Unicode 
arguments to NSTask",
as that's trivial - you just pass them in; NSTask doesn't care. 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.

Related mailsAuthorDate
mlNon-ASCII NSTask arguments Martin Aug 22, 19:04
mlRe: Non-ASCII NSTask arguments Nick Zitzmann Aug 22, 19:36
mlRe: Non-ASCII NSTask arguments Steve Christensen Aug 22, 20:43
mlRe: Non-ASCII NSTask arguments Nir Soffer Aug 24, 13:09
mlRe: Non-ASCII NSTask arguments Andrew Farmer Aug 24, 18:09
mlRe: Non-ASCII NSTask arguments Nir Soffer Aug 25, 01:02