Am 28.11.2008 um 19:22 schrieb Tommy Nordgren:

        try using -[NSString fileSystemRepresentation]

Actually, that was my 1st attempt :)

Meanwhile I have a solution better than replacing all potentially "evil" characters with an underscore:

for( i = 0; i < [temporaryPath length]; i++) {               
if( [temporaryPath characterAtIndex: i] < 0x20 ) [cleanPath appendString: @" "];
        // replace non-printable chars with a space

else if( [temporaryPath characterAtIndex: i] == ':' ) [cleanPath appendString: @"-"];
        //replace directory identifier with a dash

else [cleanPath appendFormat: @"%C", [temporaryPath characterAtIndex: i]];
        // let others go through
}

Cheers,

Knut



_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to