Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should i use ISO 3166 country codes (US) or culture codes (en-US)?

ISO 3166 has a list of 2 character country codes such as US, UK, FR.

A shopping cart I've used has both these codes and also the culture codes such as en-US or en-UK.

For a separate project I thought that the longer code is more useful because it at the very least tells me the language used by that country. But i cant seem to find an accurate list of them.

Should I use these 'culture codes' for tracking countries or just stick to the 2 character ISO 3166 names? What might be the catches of using either ?

I'm not sure why a shoppin cart that is locked to the english language would even care about en-US vs just US. Any insight?

Edit: Also where can I get a culture code list? Is this an ISO standard? Is it correct to assume that the country portion of a culture code is an ISO 3166 country code?

like image 543
Simon_Weaver Avatar asked Jan 01 '26 18:01

Simon_Weaver


1 Answers

Country codes are used to identify countries. Simply countries.

Culture codes serve to identify cultures to refer to their specifics, like decimal signs, date separator, currencies etc. Here you are not directly interested in a country but in a particular culture.

If you need to simply track countries then stick with ISO 3166 codes. It is a good and simple standard. If you do something like IP-to-country determination, then most services will only give you countries but not specific user cultures.

You really need to tell us what usage scenario you have in mind, then it will be possible to advice better.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!