The value of CNContactsUserDefaults.shared().countryCode.uppercased() is actually address format, not the current region user has set on macOS. On top if user deletes default value or has been upgrading from old macOS version it will have legacy values which cause the korean bug....
This was already mentioned before in #694

|
// macCatalyst OS bug if language is set to Korean |
// macCatalyst OS bug if language is set to Korean
// CNContactsUserDefaults.shared().countryCode will return ko instead of kr
// Failed parsing any phone number.
let countryCode = CNContactsUserDefaults.shared().countryCode.uppercased()
import Contacts
let locale = Locale.current
locale.language
locale.region
let countryCode = CNContactsUserDefaults.shared().countryCode.uppercased()
print(countryCode)
This will print SK and SN (region Slovakia but address format Senegal)
New Issue Checklist
Steps to reproduce
Expected result
Actual result
Environment
The value of
CNContactsUserDefaults.shared().countryCode.uppercased()is actually address format, not the current region user has set on macOS. On top if user deletes default value or has been upgrading from old macOS version it will have legacy values which cause the korean bug....This was already mentioned before in #694
PhoneNumberKit/PhoneNumberKit/PhoneNumberUtility.swift
Line 292 in d0bb339
This will print SK and SN (region Slovakia but address format Senegal)
New Issue Checklist
Steps to reproduce
Expected result
Actual result
Environment