• 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: 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

References: 
 >Non-ASCII NSTask arguments (From: Martin <email@hidden>)
 >Re: Non-ASCII NSTask arguments (From: Nir Soffer <email@hidden>)
 >Re: Non-ASCII NSTask arguments (From: Andrew Farmer <email@hidden>)

  • Prev by Date: Re: Progress bar jitters
  • Next by Date: Process events in a QuickTime export callback
  • Previous by thread: Re: Non-ASCII NSTask arguments
  • Next by thread: Announcing ForgEdit
  • Index(es):
    • Date
    • Thread