Re: LATIN SMALL LETTER U WITH DIAERESIS

2013-07-18 Thread Tom Davie
A workaround would be to use +[NSFileHandle fileHandleForWritingAtURL: error:] 
and -[NSFileHandle fileDescriptor] to get you a FD to use in C land.

Tom Davie

On Jul 17, 2013, at 11:26 PM, koko k...@highrolls.net wrote:

 With this character:
 
 LATIN SMALL LETTER U WITH DIAERESIS
 Unicode: U+00FC, UTF-8: C3 BC
 
 in a file path (as the folder name)
 
 which I get from the NSSavePanel -filename I cannot save to the path.
 
 Some code
 
 NSString *filepath = [savePanel filename];
 const char * cFilePath = [[NSFileManager defaultManager] 
 fileSystemRepresentationWithPath:filepath];
 
 
 Then in my low level I/O:
 
 FILE* f = NULL;
 f = fopen(path, mode);
 
 f is NULL i.e. path (the cFilePath from above) cannot open a file file 
 writing.
 
 How should I get around this?
 
 -koko
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/tom.davie%40gmail.com
 
 This email sent to tom.da...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: LATIN SMALL LETTER U WITH DIAERESIS

2013-07-18 Thread koko
Thanks for all the input … I looked at everything presented and suggested and 
in so doing realized that I was causing the problem

It all works now

Get the Path

1. get nsstring filename from save panel
2. convert to utf8
3. store utf8 in my model file name object

Use the Path
1. Get utf8 from my model file name object
2. convert to utf8 to file system representation
3. use it

-koko


On Jul 17, 2013, at 4:54 PM, Tom Davie tom.da...@gmail.com wrote:

 A workaround would be to use +[NSFileHandle fileHandleForWritingAtURL: 
 error:] and -[NSFileHandle fileDescriptor] to get you a FD to use in C land.
 
 Tom Davie
 
 On Jul 17, 2013, at 11:26 PM, koko k...@highrolls.net wrote:
 
 With this character:
 
 LATIN SMALL LETTER U WITH DIAERESIS
 Unicode: U+00FC, UTF-8: C3 BC
 
 in a file path (as the folder name)
 
 which I get from the NSSavePanel -filename I cannot save to the path.
 
 Some code
 
 NSString *filepath = [savePanel filename];
 const char * cFilePath = [[NSFileManager defaultManager] 
 fileSystemRepresentationWithPath:filepath];
 
 
 Then in my low level I/O:
 
 FILE* f = NULL;
 f = fopen(path, mode);
 
 f is NULL i.e. path (the cFilePath from above) cannot open a file file 
 writing.
 
 How should I get around this?
 
 -koko
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/tom.davie%40gmail.com
 
 This email sent to tom.da...@gmail.com
 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

LATIN SMALL LETTER U WITH DIAERESIS

2013-07-17 Thread koko
With this character:

LATIN SMALL LETTER U WITH DIAERESIS
Unicode: U+00FC, UTF-8: C3 BC

in a file path (as the folder name)

which I get from the NSSavePanel -filename I cannot save to the path.

Some code

NSString *filepath = [savePanel filename];
const char * cFilePath = [[NSFileManager defaultManager] 
fileSystemRepresentationWithPath:filepath];


Then in my low level I/O:

FILE* f = NULL;
f = fopen(path, mode);

f is NULL i.e. path (the cFilePath from above) cannot open a file file writing.

How should I get around this?

-koko
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: LATIN SMALL LETTER U WITH DIAERESIS

2013-07-17 Thread Keary Suska
On Jul 17, 2013, at 3:26 PM, koko wrote:

 With this character:
 
 LATIN SMALL LETTER U WITH DIAERESIS
 Unicode: U+00FC, UTF-8: C3 BC
 
 in a file path (as the folder name)
 
 which I get from the NSSavePanel -filename I cannot save to the path.
 
 Some code
 
 NSString *filepath = [savePanel filename];
 const char * cFilePath = [[NSFileManager defaultManager] 
 fileSystemRepresentationWithPath:filepath];
 
 
 Then in my low level I/O:
 
 FILE* f = NULL;
 f = fopen(path, mode);
 
 f is NULL i.e. path (the cFilePath from above) cannot open a file file 
 writing.
 
 How should I get around this?


use -URL instead? -filename is deprecated...

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: LATIN SMALL LETTER U WITH DIAERESIS

2013-07-17 Thread Uli Kusterer
On Jul 17, 2013, at 23:26, koko k...@highrolls.net wrote:
 NSString *filepath = [savePanel filename];
 const char * cFilePath = [[NSFileManager defaultManager] 
 fileSystemRepresentationWithPath:filepath];
 
 Then in my low level I/O:
 
 FILE* f = NULL;
 f = fopen(path, mode);
 
 f is NULL i.e. path (the cFilePath from above) cannot open a file file 
 writing.
 
 How should I get around this?

Have you tried using NSString’s -fileSystemRepresentation instead of the one in 
NSFileManager? Are you sure you’re passing the exact string in cFilePath to 
fopen()? Are you sure the path is still valid? (As soon as filepath is released 
or the current autorelease pool goes out of scope, the memory pointed to by 
cFilePath may be released) Add some logging, see if it logs the same thing for 
cFilePath and path. Also, what mode are you using? Does your user have write 
access to the folder you’re trying to save to? What file system is the 
destination disk formatted as?

— Uli
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com