Reputation: 12215
I think I found a bug in iOS Czech contacts. I've created a Czech contact (With Czech Republic country) that i selected in my application with a ABPeoplePickerNavigationController.
The log of address that ABPeoplePickerNavigationController returned me is:
"Country" : "Czech Republic"
"Street" : "A street"
"CountryCode" : "cs"
"City" : "A city"
"ZIP" : "12345"
So the country code is CS. But when I attempt to retreive the corresponding name,
NSString *countryCode = [address objectForKey:(NSString *)kABPersonAddressCountryCodeKey];
if (countryCode != nil) {
NSString *countryName = [[NSLocale currentLocale] displayNameForKey:NSLocaleCountryCode value:countryCode];
name = [[applicationDelegate dataManager] objectForEntityForName:@"Name" withValue:countryName forKey:@"name"];
}
name
gives me : "Serbia and Montenegro" !
According to http://countrycode.org/, the Czech country code is CK, and according to http://xml.coverpages.org/country3166.html, CS is for Czechoslovakia, but "no longer exists"
How would I tell this at Apple ?
Upvotes: 0
Views: 893
Reputation: 11
You are mixing up country codes (ISO 3166-X) and language codes (ISO 639-X). The language code for Czech language according to ISO 639-1 is "CS".
http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
Note: A long time ago this also used to be the country code for former "Czechoslovakia" in ISO 3166-1, but it has been changed and reassigned (e.g. to Serbia and Montenegro, which now is "YU") several times due to political changes.
Upvotes: 1