discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copying files with special characters


From: Richard Frith-Macdonald
Subject: Re: Copying files with special characters
Date: Wed, 10 Sep 2008 08:50:46 +0100


On 10 Sep 2008, at 05:48, Sheldon Gill wrote:
I think the correct *step way would be:

BOOL did_copy;
NSString sourcePath = @"German Fährhaus.jpeg";

The meaning of 'ä' in the string literal is undefined ... strictly speaking a string literal must only contain us-ascii characters. You could use a unicode escape sequence in a property list to work round this ...

sourcePath = [@"\"German F\U00E4hrhaus.jpeg\"" propertyList];


NSString destPath = [[NSHomeDirectory()] stringByAppendingPathComponent: @"A00"];
NSFileManager *fileManager = [NSFileManager defaultManager];

if ([fileManager fileExistsAtPath: sourcePath])
{
    did_copy = [fileManager copyPath:sourcePath
                              toPath:destPath
                             handler:nil];
}


If this doesn't work on your system, please file a bug as it should work everywhere GNUstep does. That said, it would appear to be a problem with your OS/locale combination.

Yes.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]