2

Running locale -av in the terminal window gives me (only showing first two items of output):

locale: en_AG           archive: /usr/lib/locale/locale-archive
-------------------------------------------------------------------------------
    title | English language locale for Antigua and Barbuda
   source | Free Software Foundation, Inc.
  address | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    email | bug-glibc-locales@gnu.org
 language | English
territory | Antigua and Barbuda
 revision | 1.0
     date | 2008-09-16
  codeset | UTF-8

locale: en_AG.utf8      archive: /usr/lib/locale/locale-archive
-------------------------------------------------------------------------------
    title | English language locale for Antigua and Barbuda
   source | Free Software Foundation, Inc.
  address | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    email | bug-glibc-locales@gnu.org
 language | English
territory | Antigua and Barbuda
 revision | 1.0
     date | 2008-09-16
  codeset | UTF-8
  • What is the difference beween locale en_AG and en_AG.utf8?
  • Why is locale en_AG using UTF-8 codeset, even though there is no codeset modifier in its name?
3

When you give a locale by the name language_COUNTRY, you actually specify one of the locales defined as language_COUNTRY.codeset: the default one for this language and country. In the case of en_AG, it appears that the default codeset is UTF8. For en_US, it is ISO-8859-1, and therefore en_US is in fact equivalent to en_US.ISO-8859-1.

  • An implication of this behavior is that one cannot determine the encoding used by the user's current locale by inspecting the LANG variable as in this question. For example, to check if the current locale's encoding is UTF-8, it is not sufficient to check if the LANG variable matches the strings utf8, UTF-8 or utf-8. – Håkon Hægland Jun 20 '15 at 4:34
  • So then en_AG locale is identical to en_AG.utf8 locale ? (en_AG is just an alias for en_AG.utf8) – Håkon Hægland Jun 20 '15 at 6:37
  • In your case yes. If locale en_AG.ISO-8859-1 is possible and if it were the only en_AG locale you have, then en_AG would be an alias to en_AG.ISO-8859-1. – lgeorget Jun 20 '15 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.