• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unicode filenames with Apple File System and UIManagedDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode filenames with Apple File System and UIManagedDocument


  • Subject: Re: Unicode filenames with Apple File System and UIManagedDocument
  • From: Jean-Daniel <email@hidden>
  • Date: Tue, 21 Mar 2017 13:33:54 +0100

> Le 21 mars 2017 à 12:03, email@hidden a écrit :
>
>>
>> On Mar 21, 2017, at 1:06 AM, Jens Alfke <email@hidden> wrote:
>>
>>
>>> On Mar 20, 2017, at 2:23 PM, email@hidden wrote:
>>>
>>> NSURL *url = [[self courseDirectory] URLByAppendingPathComponent:name];
>>
>> There’s nothing wrong with that call; it’s the canonical way to add a path component to a URL, filesystem or not.
>>
>>> NSURL *url = [NSURL fileURLWithFileSystemRepresentation:[name fileSystemRepresentation] isDirectory:YES relativeToURL:[self courseDirectory]];
>>
>> This call doesn’t make sense. You’re converting to filesystem representation and then back again, for no reason.
>>
>> What Apple suggested is to Unicode-normalize the filename before adding it to the URL. Did you try doing that?
>>
>> —Jens
>
> Jens,
>
> I’m trying to find out what that means. Someone suggested off-list to me that I should be calling this:
>
> https://developer.apple.com/reference/foundation/nsstring/1409474-decomposedstringwithcanonicalmap?language=objc <https://developer.apple.com/reference/foundation/nsstring/1409474-decomposedstringwithcanonicalmap?language=objc>
>
> Is that correct?
>
> So based on that, I think it means I should do:
>
> NSURL *url = [[self courseDirectory] URLByAppendingPathComponent:name.decomposedStringWithCanonicalMapping];
>
> Thanks,
> Dave Reed
>


This is what the reply suggest but that make no sens for me. If you are accessing the file using URL, that the work of the framework to convert the URL into the right file system representation.

That said, if using name.decomposedStringWithCanonicalMapping fix your problem, so go with it.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Unicode filenames with Apple File System and UIManagedDocument
      • From: Alastair Houghton <email@hidden>
    • Re: Unicode filenames with Apple File System and UIManagedDocument
      • From: email@hidden
References: 
 >Re: Unicode filenames with Apple File System and UIManagedDocument (From: Peter Edberg <email@hidden>)
 >Re: Unicode filenames with Apple File System and UIManagedDocument (From: Uli Kusterer <email@hidden>)
 >Re: Unicode filenames with Apple File System and UIManagedDocument (From: email@hidden)
 >Re: Unicode filenames with Apple File System and UIManagedDocument (From: Jens Alfke <email@hidden>)
 >Re: Unicode filenames with Apple File System and UIManagedDocument (From: email@hidden)

  • Prev by Date: Handling Cocoa Bindings over a tree of View Controllers
  • Next by Date: Re: Unicode filenames with Apple File System and UIManagedDocument
  • Previous by thread: Re: Unicode filenames with Apple File System and UIManagedDocument
  • Next by thread: Re: Unicode filenames with Apple File System and UIManagedDocument
  • Index(es):
    • Date
    • Thread