-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
store and compare file names as suggested in DSStoreFormat.pod
From http://search.cpan.org/~wiml/Mac-Finder-DSStore/DSStoreFormat.pod: "My guess is that the string comparison follows the same rules as HFS+ described in Apple's TN1150." https://developer.apple.com/legacy/library/technotes/tn/tn1150.html specifies that "Unicode strings will be stored in fully decomposed form, with composing characters stored in canonical order" and contains a FastUnicodeCompare routine defined as the "HFS Plus case-insensitive string comparison algorithm" The unorm module is used to fully decompose and canonically order filename strings. The FastUnicodeCompare routine is implemented as HFSPlusFastUnicodeCompare and used in Entry.sort instead of localeCompare. This solves LinusU/node-appdmg#33. (At first I only added .toLowerCase() to filename strings in Entry.sort, which solved the issue, but only in case of names containing only latin letters without diacritics.)
- Loading branch information
Showing
2 changed files
with
169 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters