Re: encoding of file names
Re: encoding of file names
- Subject: Re: encoding of file names
- From: Aki Inoue <email@hidden>
- Date: Mon, 23 May 2011 22:00:51 -0700
-[NSString compare:] and its variants can handle the normalization properly.
Aki Inoue
On 2011/05/23, at 21:41, Howard Siegel <email@hidden> wrote:
> Look at NSString's decomposedStringWithCanonicalMapping and
> decomposedStringWithCompatibilityMapping methods. They'll map
> Unicode strings to normalized forms that you can then use and
> compare.
>
> - h
>
> On Mon, May 23, 2011 at 21:22, Chris Idou <email@hidden> wrote:
>
>>
>>
>> If I take a string from an NSTextField with an accented character: café and
>> I
>> make this into a file name and write a file, then I read that file name
>> back in
>> (using NSFileManager contentsOfDirectoryAtPath), then the string read back
>> in,
>> still looks the same: an accented café, but the strings don't compare
>> anymore.
>> The one in the text field was unichars: 99,97,102,233 and the one in the
>> file
>> name is now 99,97,102,101,769.
>>
>> What does it mean, and how can I make sure I get them both the same and
>> comparable?
>> _______________________________________________
>>
>> 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
>>
> _______________________________________________
>
> 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
_______________________________________________
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