{
    "content": [
        {
            "type": "text",
            "text": "# LOCALE (info)\n\n## NAME\n\nlocale - get locale-specific information\n\n## SYNOPSIS\n\nlocale [option]\nlocale [option] -a\nlocale [option] -m\nlocale [option] name...\n\n## DESCRIPTION\n\nA  locale is a set of language and cultural rules.  These cover aspects\nsuch as language for messages, different character sets,  lexicographic\nconventions,  and  so  on.  A program needs to be able to determine its\nlocale and act accordingly to be portable to different cultures.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **FILES**\n- **CONFORMING TO**\n- **EXAMPLES**\n- **SEE ALSO**\n- **COLOPHON**\n- **WARNING**\n- **NOTES**\n- **ENVIRONMENT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "LOCALE",
        "section": "",
        "mode": "info",
        "summary": "locale - get locale-specific information",
        "synopsis": "locale [option]\nlocale [option] -a\nlocale [option] -m\nlocale [option] name...",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "-a",
                "long": "--all-locales",
                "arg": null,
                "description": "Display a list of all available locales. The -v option causes the LCIDENTIFICATION metadata about each locale to be included in the output."
            },
            {
                "flag": "-m",
                "long": "--charmaps",
                "arg": null,
                "description": "Display the available charmaps (character set description files). To display the current character set for the locale, use locale -c charmap. The locale command can also be provided with one or more arguments, which are the names of locale keywords (for example, datefmt, ctype- class-names, yesexpr, or decimalpoint) or locale categories (for exam- ple, LCCTYPE or LCTIME). For each argument, the following is dis- played: * For a locale keyword, the value of that keyword to be displayed. * For a locale category, the values of all keywords in that category are displayed. When arguments are supplied, the following options are meaningful:"
            },
            {
                "flag": "-c",
                "long": "--category-name",
                "arg": null,
                "description": "For a category name argument, write the name of the locale cate- gory on a separate line preceding the list of keyword values for that category. For a keyword name argument, write the name of the locale cate- gory for this keyword on a separate line preceding the keyword value. This option improves readability when multiple name arguments are specified. It can be combined with the -k option."
            },
            {
                "flag": "-k",
                "long": "--keyword-name",
                "arg": null,
                "description": "For each keyword whose value is being displayed, include also the name of that keyword, so that the output has the format: keyword=\"value\" The locale command also knows about the following options:"
            },
            {
                "flag": "-v",
                "long": "--verbose",
                "arg": null,
                "description": "Display additional information for some command-line option and argument combinations. -?, --help Display a summary of command-line options and arguments and exit."
            },
            {
                "flag": "",
                "long": "--usage",
                "arg": null,
                "description": "Display a short usage message and exit."
            },
            {
                "flag": "-V",
                "long": "--version",
                "arg": null,
                "description": "Display the program version and exit."
            }
        ],
        "examples": [
            "$ locale",
            "LANG=enUS.UTF-8",
            "LCCTYPE=\"enUS.UTF-8\"",
            "LCNUMERIC=\"enUS.UTF-8\"",
            "LCTIME=\"enUS.UTF-8\"",
            "LCCOLLATE=\"enUS.UTF-8\"",
            "LCMONETARY=\"enUS.UTF-8\"",
            "LCMESSAGES=\"enUS.UTF-8\"",
            "LCPAPER=\"enUS.UTF-8\"",
            "LCNAME=\"enUS.UTF-8\"",
            "LCADDRESS=\"enUS.UTF-8\"",
            "LCTELEPHONE=\"enUS.UTF-8\"",
            "LCMEASUREMENT=\"enUS.UTF-8\"",
            "LCIDENTIFICATION=\"enUS.UTF-8\"",
            "LCALL=",
            "$ locale datefmt",
            "%a %b %e %H:%M:%S %Z %Y",
            "$ locale -k datefmt",
            "datefmt=\"%a %b %e %H:%M:%S %Z %Y\"",
            "$ locale -ck datefmt",
            "LCTIME",
            "datefmt=\"%a %b %e %H:%M:%S %Z %Y\"",
            "$ locale LCTELEPHONE",
            "+%c (%a) %l",
            "(%a) %l",
            "11",
            "UTF-8",
            "$ locale -k LCTELEPHONE",
            "telintfmt=\"+%c (%a) %l\"",
            "teldomfmt=\"(%a) %l\"",
            "intselect=\"11\"",
            "intprefix=\"1\"",
            "telephone-codeset=\"UTF-8\"",
            "The following example compiles a custom locale from the ./wrk directory",
            "with  the  localedef(1) utility under the $HOME/.locale directory, then",
            "tests the result with the date(1) command, and then sets  the  environ-",
            "ment  variables  LOCPATH and LANG in the shell profile file so that the",
            "custom locale will be used in the subsequent user sessions:",
            "$ mkdir -p $HOME/.locale",
            "$ I18NPATH=./wrk/ localedef -f UTF-8 -i fiSE $HOME/.locale/fiSE.UTF-8",
            "$ LOCPATH=$HOME/.locale LCALL=fiSE.UTF-8 date",
            "$ echo \"export LOCPATH=\\$HOME/.locale\" >> $HOME/.bashrc",
            "$ echo \"export LANG=fiSE.UTF-8\" >> $HOME/.bashrc"
        ],
        "see_also": [
            {
                "name": "localedef",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/localedef/1/json"
            },
            {
                "name": "charmap",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/charmap/5/json"
            },
            {
                "name": "locale",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/locale/5/json"
            },
            {
                "name": "locale",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/locale/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 201,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "CONFORMING TO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 52,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COLOPHON",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "WARNING",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 16,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 15,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "locale - description of multilanguage support\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "#include <locale.h>\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "A  locale is a set of language and cultural rules.  These cover aspects\nsuch as language for messages, different character sets,  lexicographic\nconventions,  and  so  on.  A program needs to be able to determine its\nlocale and act accordingly to be portable to different cultures.\n\nThe header <locale.h> declares data types, functions and  macros  which\nare useful in this task.\n\nThe  functions  it declares are setlocale(3) to set the current locale,\nand localeconv(3) to get information about number formatting.\n\nThere are different categories for locale information a  program  might\nneed; they are declared as macros.  Using them as the first argument to\nthe setlocale(3) function, it is possible to set one of  these  to  the\ndesired locale:\n\nLCADDRESS (GNU extension, since glibc 2.2)\nChange  settings  that  describe  the  formats (e.g., postal ad-\ndresses) used to describe locations and geography-related items.\nApplications  that  need this information can use nllanginfo(3)\nto retrieve  nonstandard  elements,  such  as  NLADDRESSCOUN-\nTRYNAME  (country  name,  in  the  language  of the locale) and\nNLADDRESSLANGNAME (language name, in the language of the lo-\ncale),  which return strings such as \"Deutschland\" and \"Deutsch\"\n(for German-language locales).  (Other element names are  listed\nin <langinfo.h>.)\n\nLCCOLLATE\nThis  category  governs the collation rules used for sorting and\nregular expressions, including character equivalence classes and\nmulticharacter collating elements.  This locale category changes\nthe behavior of the functions strcoll(3) and  strxfrm(3),  which\nare used to compare strings in the local alphabet.  For example,\nthe German sharp s is sorted as \"ss\".\n\nLCCTYPE\nThis category determines the interpretation of byte sequences as\ncharacters (e.g., single versus multibyte characters), character\nclassifications (e.g., alphabetic or digit), and the behavior of\ncharacter  classes.  On glibc systems, this category also deter-\nmines the  character  transliteration  rules  for  iconv(1)  and\niconv(3).  It changes the behavior of the character handling and\nclassification functions, such as isupper(3) and toupper(3), and\nthe multibyte character functions such as mblen(3) or wctomb(3).\n\nLCIDENTIFICATION (GNU extension, since glibc 2.2)\nChange settings that relate to the metadata for the locale.  Ap-\nplications that need this information can use nllanginfo(3)  to\nretrieve  nonstandard elements, such as NLIDENTIFICATIONTITLE\n(title of this locale document) and NLIDENTIFICATIONTERRITORY\n(geographical  territory to which this locale document applies),\nwhich might return strings such as \"English locale for the  USA\"\nand \"USA\".  (Other element names are listed in <langinfo.h>.)\n\nLCMONETARY\nThis  category  determines  the formatting used for monetary-re-\nlated numeric values.  This changes the information returned  by\nlocaleconv(3),  which  describes  the  way  numbers  are usually\nprinted, with details  such  as  decimal  point  versus  decimal\ncomma.   This  information  is  internally  used by the function\nstrfmon(3).\n\nLCMESSAGES\nThis category affects the language in which  messages  are  dis-\nplayed  and  what  an affirmative or negative answer looks like.\nThe GNU C library contains the gettext(3), ngettext(3), and  rp-\nmatch(3) functions to ease the use of this information.  The GNU\ngettext family of functions also obey the  environment  variable\nLANGUAGE  (containing  a colon-separated list of locales) if the\ncategory is set to a valid locale other than \"C\".  This category\nalso affects the behavior of catopen(3).\n\nLCMEASUREMENT (GNU extension, since glibc 2.2)\nChange  the  settings  relating to the measurement system in the\nlocale (i.e., metric versus US customary  units).   Applications\ncan  use nllanginfo(3) to retrieve the nonstandard NLMEASURE-\nMENTMEASUREMENT element, which returns a pointer to a character\nthat has the value 1 (metric) or 2 (US customary units).\n\nLCNAME (GNU extension, since glibc 2.2)\nChange  settings  that describe the formats used to address per-\nsons.  Applications that need this information can use  nllang-\ninfo(3)    to    retrieve    nonstandard   elements,   such   as\nNLNAMENAMEMR    (general    salutation    for    men)    and\nNLNAMENAMEMS  (general salutation for women) elements, which\nreturn strings such as \"Herr\" and  \"Frau\"  (for  German-language\nlocales).  (Other element names are listed in <langinfo.h>.)\n\nLCNUMERIC\nThis  category determines the formatting rules used for nonmone-\ntary numeric values--for example, the  thousands  separator  and\nthe  radix  character  (a  period in most English-speaking coun-\ntries, but a comma in many other regions).  It affects functions\nsuch  as  printf(3),  scanf(3), and strtod(3).  This information\ncan also be read with the localeconv(3) function.\n\nLCPAPER (GNU extension, since glibc 2.2)\nChange the settings relating to the dimensions of  the  standard\npaper  size (e.g., US letter versus A4).  Applications that need\nthe dimensions can obtain them by using  nllanginfo(3)  to  re-\ntrieve the nonstandard NLPAPERWIDTH and NLPAPERHEIGHT ele-\nments, which return int values specifying the dimensions in mil-\nlimeters.\n\nLCTELEPHONE (GNU extension, since glibc 2.2)\nChange  settings that describe the formats to be used with tele-\nphone services.  Applications that need this information can use\nnllanginfo(3)   to   retrieve  nonstandard  elements,  such  as\nNLTELEPHONEINTPREFIX (international prefix used to call num-\nbers  in  this locale), which returns a string such as \"49\" (for\nGermany).  (Other element names are listed in <langinfo.h>.)\n\nLCTIME\nThis category governs the formatting used for date and time val-\nues.   For  example,  most of Europe uses a 24-hour clock versus\nthe 12-hour clock used in the United  States.   The  setting  of\nthis  category  affects  the behavior of functions such as strf-\ntime(3) and strptime(3).\n\nLCALL All of the above.\n\nIf the second argument to setlocale(3) is an empty string, \"\", for  the\ndefault locale, it is determined using the following steps:\n\n1. If  there  is  a  non-null environment variable LCALL, the value of\nLCALL is used.\n\n2. If an environment variable with the same name as one  of  the  cate-\ngories above exists and is non-null, its value is used for that cat-\negory.\n\n3. If there is a non-null environment variable LANG, the value of  LANG\nis used.\n\nValues  about  local  numeric  formatting is made available in a struct\nlconv returned by the localeconv(3) function, which has  the  following\ndeclaration:\n\nstruct lconv {\n\n/* Numeric (nonmonetary) information */\n\nchar *decimalpoint;     /* Radix character */\nchar *thousandssep;     /* Separator for digit groups to left\nof radix character */\nchar *grouping;     /* Each element is the number of digits in\na group; elements with higher indices\nare further left.  An element with value\nCHARMAX means that no further grouping\nis done.  An element with value 0 means\nthat the previous element is used for\nall groups further left. */\n\n/* Remaining fields are for monetary information */\n\nchar *intcurrsymbol;   /* First three chars are a currency\nsymbol from ISO 4217.  Fourth char\nis the separator.  Fifth char\nis '\\0'. */\nchar *currencysymbol;   /* Local currency symbol */\nchar *mondecimalpoint; /* Radix character */\nchar *monthousandssep; /* Like thousandssep above */\nchar *mongrouping;      /* Like grouping above */\nchar *positivesign;     /* Sign for positive values */\nchar *negativesign;     /* Sign for negative values */\nchar  intfracdigits;   /* International fractional digits */\nchar  fracdigits;       /* Local fractional digits */\nchar  pcsprecedes;     /* 1 if currencysymbol precedes a\npositive value, 0 if succeeds */\nchar  psepbyspace;    /* 1 if a space separates\ncurrencysymbol from a positive\nvalue */\nchar  ncsprecedes;     /* 1 if currencysymbol precedes a\nnegative value, 0 if succeeds */\nchar  nsepbyspace;    /* 1 if a space separates\ncurrencysymbol from a negative\nvalue */\n/* Positive and negative sign positions:\n0 Parentheses surround the quantity and currencysymbol.\n1 The sign string precedes the quantity and currencysymbol.\n2 The sign string succeeds the quantity and currencysymbol.\n3 The sign string immediately precedes the currencysymbol.\n4 The sign string immediately succeeds the currencysymbol. */\nchar  psignposn;\nchar  nsignposn;\n};\n\nPOSIX.1-2008 extensions to the locale API\nPOSIX.1-2008  standardized  a  number  of extensions to the locale API,\nbased on implementations that first appeared in version 2.3 of the  GNU\nC  library.   These extensions are designed to address the problem that\nthe traditional locale APIs do not mix well with multithreaded applica-\ntions and with applications that must deal with multiple locales.\n\nThe  extensions take the form of new functions for creating and manipu-\nlating locale objects (newlocale(3), freelocale(3),  duplocale(3),  and\nuselocale(3))  and  various  new library functions with the suffix \"l\"\n(e.g., toupperl(3)) that extend the traditional locale-dependent  APIs\n(e.g.,  toupper(3))  to allow the specification of a locale object that\nshould apply when executing the function.\n",
                "subsections": []
            },
            "FILES": {
                "content": "/usr/lib/locale/locale-archive\nUsual default locale archive location.\n\n/usr/lib/locale\nUsual default path for compiled individual locale files.\n",
                "subsections": []
            },
            "CONFORMING TO": {
                "content": "POSIX.1-2001.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "$ locale\nLANG=enUS.UTF-8\nLCCTYPE=\"enUS.UTF-8\"\nLCNUMERIC=\"enUS.UTF-8\"\nLCTIME=\"enUS.UTF-8\"\nLCCOLLATE=\"enUS.UTF-8\"\nLCMONETARY=\"enUS.UTF-8\"\nLCMESSAGES=\"enUS.UTF-8\"\nLCPAPER=\"enUS.UTF-8\"\nLCNAME=\"enUS.UTF-8\"\nLCADDRESS=\"enUS.UTF-8\"\nLCTELEPHONE=\"enUS.UTF-8\"\nLCMEASUREMENT=\"enUS.UTF-8\"\nLCIDENTIFICATION=\"enUS.UTF-8\"\nLCALL=\n\n$ locale datefmt\n%a %b %e %H:%M:%S %Z %Y\n\n$ locale -k datefmt\ndatefmt=\"%a %b %e %H:%M:%S %Z %Y\"\n\n$ locale -ck datefmt\nLCTIME\ndatefmt=\"%a %b %e %H:%M:%S %Z %Y\"\n\n$ locale LCTELEPHONE\n+%c (%a) %l\n(%a) %l\n11\n1\nUTF-8\n\n$ locale -k LCTELEPHONE\ntelintfmt=\"+%c (%a) %l\"\nteldomfmt=\"(%a) %l\"\nintselect=\"11\"\nintprefix=\"1\"\ntelephone-codeset=\"UTF-8\"\n\nThe following example compiles a custom locale from the ./wrk directory\nwith  the  localedef(1) utility under the $HOME/.locale directory, then\ntests the result with the date(1) command, and then sets  the  environ-\nment  variables  LOCPATH and LANG in the shell profile file so that the\ncustom locale will be used in the subsequent user sessions:\n\n$ mkdir -p $HOME/.locale\n$ I18NPATH=./wrk/ localedef -f UTF-8 -i fiSE $HOME/.locale/fiSE.UTF-8\n$ LOCPATH=$HOME/.locale LCALL=fiSE.UTF-8 date\n$ echo \"export LOCPATH=\\$HOME/.locale\" >> $HOME/.bashrc\n$ echo \"export LANG=fiSE.UTF-8\" >> $HOME/.bashrc\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "iconv(1), locale(1), localedef(1),  catopen(3),  gettext(3),  iconv(3),\nlocaleconv(3),  mbstowcs(3), newlocale(3), ngettext(3), nllanginfo(3),\nrpmatch(3),   setlocale(3),   strcoll(3),   strfmon(3),    strftime(3),\nstrxfrm(3),  uselocale(3),  wcstombs(3),  locale(5),  charsets(7), uni-\ncode(7), utf-8(7)\n",
                "subsections": []
            },
            "COLOPHON": {
                "content": "This page is part of release 5.10 of the Linux  man-pages  project.   A\ndescription  of  the project, information about reporting bugs, and the\nlatest    version    of    this    page,    can     be     found     at\nhttps://www.kernel.org/doc/man-pages/.\n\nLinux                             2019-03-06                         LOCALE(7)",
                "subsections": []
            },
            "WARNING": {
                "content": "DO NOT USE this pragma in scripts that have multiple threads active.\nThe locale is not local to a single thread.  Another thread may change\nthe locale at any time, which could cause at a minimum that a given\nthread is operating in a locale it isn't expecting to be in.  On some\nplatforms, segfaults can also occur.  The locale change need not be\nexplicit; some operations cause perl to change the locale itself.  You\nare vulnerable simply by having done a \"use locale\".\n",
                "subsections": []
            },
            "NOTES": {
                "content": "The collective GNU C library community  wisdom  regarding  abday,  day,\nweek,   firstweekday,  and  firstworkday  states  at  https://source-\nware.org/glibc/wiki/Locales the following:\n\n*  The value of the second week list item specifies the base of the ab-\nday and day lists.\n\n*  firstweekday  specifies  the offset of the first day-of-week in the\nabday and day lists.\n\n*  For compatibility reasons, all glibc locales should set the value of\nthe  second  week  list item to 19971130 (Sunday) and base the abday\nand day lists appropriately, and set firstweekday and firstworkday\nto  1  or  2,  depending  on whether the week and work week actually\nstarts on Sunday or Monday for the locale.\n",
                "subsections": []
            },
            "ENVIRONMENT": {
                "content": "The following environment variable is used by newlocale(3)  and  setlo-\ncale(3), and thus affects all unprivileged localized programs:\n\nLOCPATH\nA  list  of pathnames, separated by colons (':'), that should be\nused to find locale data.  If this variable is set, only the in-\ndividual  compiled locale data files from LOCPATH and the system\ndefault locale data path are used; any available locale archives\nare not used (see localedef(1)).  The individual compiled locale\ndata files are searched for under subdirectories which depend on\nthe  currently  used  locale.   For example, when enGB.UTF-8 is\nused for a category, the following subdirectories  are  searched\nfor,  in  this  order: enGB.UTF-8, enGB.utf8, enGB, en.UTF-8,\nen.utf8, and en.\n",
                "subsections": []
            }
        }
    }
}