Sort Japanese contacts as in the Native Contacts app

Hi,


I'm developing an app where I need to present the full contacts list of the user with the same exact sections/ordering as the ones shown in the Native Contacts app. When working with Japanese contacts (and having the device language in Japanese) I'm unable to sort the Contacts into the same order as the one from the Native app.
Is it possible that I'm doing something wrong or there's really no API that allows me to sort Japanse contacts the same way as the Native contacts app?


Thank you!

Which if the localized sorting mechanisms have you tried using?

I used the following API:


    NSArray<CNContact *> *contacts = [self allContacts];
    NSComparator comparator = [CNContact comparatorForNameSortOrder:CNContactSortOrderUserDefault];
    NSArray<CNContact *> *sortedContacts = [contacts sortedArrayUsingComparator:comparator];

My understanding is that you have to use this 'default': https://developer.apple.com/documentation/contacts/cncontactsuserdefaults/1402779-sortorder

instead of CNContactSortOrderUserDefault.

I believe that using:

[CNContact comparatorForNameSortOrder:CNContactSortOrderUserDefault]

is the same as using:

[CNContact comparatorForNameSortOrder:[CNContactsUserDefaults sharedDefaults].sortOrder]

For sorting the contacts the same way as the native contacts app the best approach I found so far was using the "localizedCaseInsensitiveCompare" string on the contact names. But still there are some differences :/

Sort Japanese contacts as in the Native Contacts app
 
 
Q