• 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
Re: Non-ASCII NSTask arguments
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Non-ASCII NSTask arguments


  • Subject: Re: Non-ASCII NSTask arguments
  • From: Andrew Farmer <email@hidden>
  • Date: Thu, 24 Aug 2006 09:09:01 -0700

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.

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

  • Follow-Ups:
    • Re: Non-ASCII NSTask arguments
      • From: Nir Soffer <email@hidden>
References: 
 >Non-ASCII NSTask arguments (From: Martin <email@hidden>)
 >Re: Non-ASCII NSTask arguments (From: Nir Soffer <email@hidden>)

  • Prev by Date: Re: Tiger apps on Panther
  • Next by Date: Re: Tiger apps on Panther
  • Previous by thread: Re: Non-ASCII NSTask arguments
  • Next by thread: Re: Non-ASCII NSTask arguments
  • Index(es):
    • Date
    • Thread