{
    "mode": "info",
    "parameter": "I18N::Langinfo",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/I18N%3A%3ALanginfo/json",
    "generated": "2026-07-05T13:46:09Z",
    "synopsis": "use I18N::Langinfo;",
    "sections": {
        "NAME": {
            "content": "I18N::Langinfo - query locale information\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use I18N::Langinfo;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The langinfo() function queries various locale information that can be\nused to localize output and user interfaces.  It uses the current\nunderlying locale, regardless of whether or not it was called from\nwithin the scope of \"uselocale\".  The langinfo() function requires one\nnumeric argument that identifies the locale constant to query: if no\nargument is supplied, $ is used.  The numeric constants appropriate to\nbe used as arguments are exportable from I18N::Langinfo.\n\nThe following example will import the langinfo() function itself and\nthree constants to be used as arguments to langinfo(): a constant for\nthe abbreviated first day of the week (the numbering starts from Sunday\n= 1) and two more constants for the affirmative and negative answers\nfor a yes/no question in the current locale.\n\nuse I18N::Langinfo qw(langinfo ABDAY1 YESSTR NOSTR);\n\nmy ($abday1, $yesstr, $nostr) =\nmap { langinfo($) } (ABDAY1, YESSTR, NOSTR);\n\nprint \"$abday1? [$yesstr/$nostr] \";\n\nIn other words, in the \"C\" (or English) locale the above will probably\nprint something like:\n\nSun? [yes/no]\n\nbut under a French locale\n\ndim? [oui/non]\n\nThe usually available constants are as follows.\n\no   For abbreviated and full length days of the week and months of the\nyear:\n\nABDAY1 ABDAY2 ABDAY3 ABDAY4 ABDAY5 ABDAY6 ABDAY7\nABMON1 ABMON2 ABMON3 ABMON4 ABMON5 ABMON6\nABMON7 ABMON8 ABMON9 ABMON10 ABMON11 ABMON12\nDAY1 DAY2 DAY3 DAY4 DAY5 DAY6 DAY7\nMON1 MON2 MON3 MON4 MON5 MON6\nMON7 MON8 MON9 MON10 MON11 MON12\n\no   For the date-time, date, and time formats used by the strftime()\nfunction (see POSIX):\n\nDTFMT DFMT TFMT\n\no   For the locales for which it makes sense to have ante meridiem and\npost meridiem time formats:\n\nAMSTR PMSTR TFMTAMPM\n\no   For the character code set being used (such as \"ISO8859-1\",\n\"cp850\", \"koi8-r\", \"sjis\", \"utf8\", etc.), and for the currency\nstring:\n\nCODESET CRNCYSTR\n\no   For an alternate representation of digits, for the radix character\nused between the integer and the fractional part of decimal\nnumbers, the group separator string for large-ish floating point\nnumbers (yes, the final two are redundant with\nPOSIX::localeconv()):\n\nALTDIGITS RADIXCHAR THOUSEP\n\no   For the affirmative and negative responses and expressions:\n\nYESSTR YESEXPR NOSTR NOEXPR\n\no   For the eras based on typically some ruler, such as the Japanese\nEmperor (naturally only defined in the appropriate locales):\n\nERA ERADFMT ERADTFMT ERATFMT\n\nFor systems without \"nllanginfo\"\nStarting in Perl 5.28, this module is available even on systems that\nlack a native \"nllanginfo\".  On such systems, it uses various methods\nto construct what that function, if present, would return.  But there\nare potential glitches.  These are the items that could be different:\n\n\"ERA\"\nUnimplemented, so returns \"\".\n\n\"CODESET\"\nUnimplemented, except on Windows, due to the vagaries of vendor\nlocale names, returning \"\" on non-Windows.\n\n\"YESEXPR\"\n\"YESSTR\"\n\"NOEXPR\"\n\"NOSTR\"\nOnly the values for English are returned.  \"YESSTR\" and \"NOSTR\"\nhave been removed from POSIX 2008, and are retained here for\nbackwards compatibility.  Your platform's \"nllanginfo\" may not\nsupport them.\n\n\"DFMT\"\nAlways evaluates to %x, the locale's appropriate date\nrepresentation.\n\n\"TFMT\"\nAlways evaluates to %X, the locale's appropriate time\nrepresentation.\n\n\"DTFMT\"\nAlways evaluates to %c, the locale's appropriate date and time\nrepresentation.\n\n\"CRNCYSTR\"\nThe return may be incorrect for those rare locales where the\ncurrency symbol replaces the radix character.  Send email to\n<mailto:perlbug@perl.org> if you have examples of it needing to\nwork differently.\n\n\"ALTDIGITS\"\nCurrently this gives the same results as Linux does.  Send email to\n<mailto:perlbug@perl.org> if you have examples of it needing to\nwork differently.\n\n\"ERADFMT\"\n\"ERATFMT\"\n\"ERADTFMT\"\n\"TFMTAMPM\"\nThese are derived by using \"strftime()\", and not all versions of\nthat function know about them.  \"\" is returned for these on such\nsystems.\n\nSee your nllanginfo(3) for more information about the available\nconstants.  (Often this means having to look directly at the langinfo.h\nC header file.)\n\nEXPORT\nBy default only the \"langinfo()\" function is exported.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Before Perl 5.28, the returned values are unreliable for the\n\"RADIXCHAR\" and \"THOUSEP\" locale constants.\n\nStarting in 5.28, changing locales on threaded builds is supported on\nsystems that offer thread-safe locale functions.  These include POSIX\n2008 systems and Windows starting with Visual Studio 2005, and this\nmodule will work properly in such situations.  However, on threaded\nbuilds on Windows prior to Visual Studio 2015, retrieving the items\n\"CRNCYSTR\" and \"THOUSEP\" can result in a race with a thread that has\nconverted to use the global locale.  It is quite uncommon for a thread\nto have done this.  It would be possible to construct a workaround for\nthis; patches welcome: see \"switchtogloballocale\" in perlapi.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "perllocale, \"localeconv\" in POSIX, \"setlocale\" in POSIX,\nnllanginfo(3).\n\nThe langinfo() function is just a wrapper for the C nllanginfo()\ninterface.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Jarkko Hietaniemi, <jhi@hut.fi>.  Now maintained by Perl 5 porters.\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "Copyright 2001 by Jarkko Hietaniemi\n\nThis library is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n\nperl v5.34.0                      2026-06-23             I18N::Langinfo(3perl)",
            "subsections": []
        }
    },
    "summary": "I18N::Langinfo - query locale information",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "nllanginfo",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/nllanginfo/3/json"
        }
    ]
}