[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSFileManager -fileExistsAtPath: exception
From: |
Fred Kiefer |
Subject: |
Re: NSFileManager -fileExistsAtPath: exception |
Date: |
Wed, 8 May 2013 09:22:03 +0200 |
I think the problem here is that GNUstep has the impression that your file
system is using Latin1, where it seems to be using UTF8.
Fred
On the road
Am 07.05.2013 um 22:15 schrieb Cameron Pulsford <cpulsfor@me.com>:
> 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?
>
>
>
> _______________________________________________
> Bug-gnustep mailing list
> Bug-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-gnustep