Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Comparing incoming AppleEvent text parameter with HFSUniStr255 file names
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comparing incoming AppleEvent text parameter with HFSUniStr255 file names



Hi Eric,

> 1) you use logical OR (||) instead of bitwise one;

Yep - thanks!  I need to be more careful at 2 AM! ; )

> 2) kCFCompareNonliteral has a horrible bug in Panther (and probably before);
> contrary to the header docs, it provides diacritical insensitivity (that is,
> o with umlaut is equivalent to o);

I actually hadn't added kCFCompareNonliteral until I found comparison ws
failing.  I've since removed it.  Thanks for the info though!

> 3) HFS+ has its own hard-coded filename collation which is not easy to match
> - not to mention other file systems!

That's the problem!  = )

>   To work around #2, use CFStringNormalize(theStr,
> kCFStringNormalizationFormD) on both strings, and then compare them
> case-insensitively.

Yep - just did that and it works as expected.  Much thanks! : )

>   But the real solution is probably FSCatalogSearch(), which fixes both #2
> and #3.

I'll look into using FSCatalogSearch() at some point in the future.  For
now, I've got a good bit of code invested in FSGetCatalogInfo(), and not
much time to rewrite it!


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-implementors mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Comparing incoming AppleEvent text parameter with HFSUniStr255 file names (From: Alexey Proskuryakov <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.