bug-gnustep
[Top][All Lists]
Advanced

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

NSFileManager -fileExistsAtPath: exception


From: Cameron Pulsford
Subject: NSFileManager -fileExistsAtPath: exception
Date: Tue, 07 May 2013 16:15:06 -0400

I am using debian wheezy with hand built gnustep 1.24 and the gcc 4.7.2 objc 
runtime.

I am getting an exception from calling [[NSFileManager defaultManager] 
fileExistsAtPath:] with the following two arguments and presumably others:

@"/home/user/GNUstep/Library/ApplicationSupport/Foo/mediaServer/Jeff Hamilton 
Trio-NS/J.Hamilton/Beatles.png"
@"/home/user/GNUstep/Library/ApplicationSupport/Foo/mediaServer/Brad White & 
Pierre Grill-Winter’s Journey.png"

Here are those strings again converted with CFStringTransform to include the 
unicode special character names:

@"/home/user/GNUstep/Library/ApplicationSupport/Foo/mediaServer/Jeff Hamilton 
Trio-NS/J.Ham\N{FULLWIDTH LATIN SMALL LETTER I}lton/Beatles.png"
@"/home/user/GNUstep/Library/ApplicationSupport/Foo/mediaServer/Brad White & 
Pierre Grill-Winter\N{RIGHT SINGLE QUOTATION MARK}s Journey.png"

Internally, that method eventually calls [GSUnicodeString 
cStringUsingEncoding:NSISOLatin1StringEncoding] which raises this exception: 
<NSException: 0x83a29bc> NAME:NSCharacterConversionException REASON:Can't get 
cString from Unicode string. INFO:(null)

I do not get this crash when running the same code on a mac. Is there any way I 
should be sanitizing strings before I pass them to the -fileExistsAtPath: 
method?





reply via email to

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