Re: Encoding to use for file names

2009-02-05 Thread Clark Cox
On Thu, Feb 5, 2009 at 9:41 AM, Nick Zitzmann wrote: > > On Feb 5, 2009, at 10:29 AM, Francis Devereux wrote: > >> I have an NSString with a filename in it that I need to pass to the >> portable code as a char *. The portable code will then pass it to UNIX file >> handling functions like fopen().

Re: Encoding to use for file names

2009-02-05 Thread Francis Devereux
On 5 Feb 2009, at 17:40, Joar Wingfors wrote: On Feb 5, 2009, at 9:29 AM, Francis Devereux wrote: I am porting an app to Mac OS X (well, actually someone else has ported it and I am building a cocoa GUI). I have an NSString with a filename in it that I need to pass to the portable code as

Re: Encoding to use for file names

2009-02-05 Thread Clark Cox
Just use: const char *filename = [nsstring fileSystemRepresentation]; On Thu, Feb 5, 2009 at 9:29 AM, Francis Devereux wrote: > Hi, > > I am porting an app to Mac OS X (well, actually someone else has ported it > and I am building a cocoa GUI). > > I have an NSString with a filename in it that I

Re: Encoding to use for file names

2009-02-05 Thread glenn andreas
On Feb 5, 2009, at 11:29 AM, Francis Devereux wrote: Hi, I am porting an app to Mac OS X (well, actually someone else has ported it and I am building a cocoa GUI). I have an NSString with a filename in it that I need to pass to the portable code as a char *. The portable code will then

Re: Encoding to use for file names

2009-02-05 Thread Douglas Davidson
On Feb 5, 2009, at 9:33 AM, David Springer wrote: I generally use UTF8. On Thu, Feb 5, 2009 at 10:29 AM, Francis Devereux wrote: Hi, I am porting an app to Mac OS X (well, actually someone else has ported it and I am building a cocoa GUI). I have an NSString with a filename in it th

Re: Encoding to use for file names

2009-02-05 Thread Nick Zitzmann
On Feb 5, 2009, at 10:29 AM, Francis Devereux wrote: I have an NSString with a filename in it that I need to pass to the portable code as a char *. The portable code will then pass it to UNIX file handling functions like fopen(). I guess that I need to use NSString's getCString:maxLength:

Re: Encoding to use for file names

2009-02-05 Thread Shawn Erickson
On Thu, Feb 5, 2009 at 9:29 AM, Francis Devereux wrote: > I guess that I need to use NSString's getCString:maxLength:encoding: method, > but what should I pass for the encoding parameter? Phrased another way, > what encoding does fopen() expect filenames to be in? -[NSString fileSystemRepresent

Re: Encoding to use for file names

2009-02-05 Thread Joar Wingfors
On Feb 5, 2009, at 9:29 AM, Francis Devereux wrote: I am porting an app to Mac OS X (well, actually someone else has ported it and I am building a cocoa GUI). I have an NSString with a filename in it that I need to pass to the portable code as a char *. The portable code will then pass it

Re: Encoding to use for file names

2009-02-05 Thread David Springer
I generally use UTF8. On Thu, Feb 5, 2009 at 10:29 AM, Francis Devereux wrote: > Hi, > > I am porting an app to Mac OS X (well, actually someone else has ported it > and I am building a cocoa GUI). > > I have an NSString with a filename in it that I need to pass to the > portable code as a char