nl_langinfo.3am - Man Page

retrieve locale-specific information strings

Synopsis

@load "nl_langinfo"

result = nl_langinfo(LANGINFO["variable"])

Description

The nl_langinfo extension provides an AWK interface to the nl_langinfo(3) C library routine.  It adds a single function named nl_langinfo(), and an array named LANGINFO.

The single argument in a call to nl_langinfo() should be one of the available values in the LANGINFO array.

The return value is the requested string, or the empty string if an error occurred.

The indices of LANGINFO are the names of various available strings as given in the POSIX standard: see http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html. For example, "D_T_FMT" is the current locale's date and time format for use with strftime(3). See the standard for the full list.

Example

@load "nl_langinfo"

# print the time and date in the locale's format
BEGIN {
    print strftime(nl_langinfo(LANGINFO["D_T_FMT"]))
}

See Also

GAWK: Effective AWK Programming,

nl_langinfo(3).

Author

Arnold Robbins, arnold@skeeve.com.

Copying Permissions

Copyright © 2012, 2013, Free Software Foundation, Inc.
Copyright © 2015, Arnold David Robbins.

Permission is granted to make and distribute verbatim copies of this manual page provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual page under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Foundation.

Referenced By

bind_textdomain_codeset(3), enca(1), find(1), iconv(1), locale(7), localeconv(3), mksh(1), nl_langinfo.3am(3), notcurses(3), perl5280delta(1), perlapi(1), rpmatch(3), setlocale(3), strftime(3), tin(1), tin(5), utf-8(7).

Jun 01 2015 GNU Awk Extension Modules