Hi
I've been playing around with the Google Maps WS API, which I think is what you're using for geocoding, nick.
If I look for a (more or less) specific address:
http://maps.google.com/maps/api/geocode ... ensor=true
One of the things you get back is the 2-letter country code:
"long_name": "España",
"short_name": "ES",
"types": [ "country", "political" ]
You could use that code returned from Google to map the flags, that way it would be independent from language and different ways to write a country's name (UK vs. U.K. vs. United Kingdom).
The problem is that Google doesn't always return the country. For example, now I'm looking for a nearby island where I usually dive:
http://maps.google.com/maps/api/geocode ... ensor=true
If you see the result there's lots of geo-political information (the city, postal code, province and community) but in this particular case the country is missing. But, if now you do a second step looking for the lat-lng on the previous result:
http://maps.google.com/maps/api/geocode ... ensor=true
voila! The country and 2-letter country code:
"long_name": "España",
"short_name": "ES",
"types": [ "country", "political" ]
I've tried with several random lat-lng and it seems that Google always returns the country and country code when you geolocate a lat-lng. So if you don't get the 2-letter code on the address search, it seems you could always do a lat-lng search then and get it.
What do you think?
Regards