nl_langinfo

Retrieves information about the current locale.

Library:LibC
Classification:ANSI
Service:Locale

Syntax

  #include <langinfo.h> 
   
  char *nl_langinfo (
     nl_item   item);
  

Parameters

item

(IN) Specifies the locale string to retrieve. See Remarks for a list of supported flags.

Return Values

If successful, returns a pointer to a locale-specific string. Otherwise, returns a pointer to an empty string.

Remarks

The nl_langinfo function retrieves the locale string which corresponds to the item specified in the item parameter. For example, if item is set to DAY_1, it returns Sunday for the English locale and Sonntag for the German locale. Set item to one of the following flags:

Flag

Value

Description

DAY_1

1

First day of the week (Sunday)

DAY_2

2

Second day of the week (Monday)

DAY_3

3

Third day of the week (Tuesday)

DAY_4

4

Fourth day of the week (Wednesday)

DAY_5

5

Fifth day of the week (Thursday)

DAY_6

6

Sixth day of the week (Friday)

DAY_7

7

Seventh day of the week (Saturday)

ABDAY_1

8

Abbreviation for the first day of the week (Sun)

ABDAY_2

9

Abbreviation for the second day of the week (Mon)

ABDAY_3

10

Abbreviation for the third day of the week (Tue)

ABDAY_4

11

Abbreviation for the fourth day of the week (Wed)

ABDAY_5

12

Abbreviation for the fifth day of the week (Thu)

ABDAY_6

13

Abbreviation for the sixth day of the week (Fri)

ABDAY_7

14

Abbreviation for the seventh day of the week (Sat)

MON_1

15

First month of the year (January)

MON_2

16

Second month of the year (February)

MON_3

17

Third month of the year (March)

MON_4

18

Fourth month of the year (April)

MON_5

19

Fifth month of the year (May)

MON_6

20

Sixth month of the year (June)

MON_7

21

Seventh month of the year (July)

MON_8

22

Eighth month of the year (August)

MON_9

23

Ninth month of the year (September)

MON_10

24

Tenth month of the year (October)

MON_11

25

Eleventh month of the year (November)

MON_12

26

Twelfth month of the year (December)

ABMON_1

27

Abbreviation for the first month of the year (Jan)

ABMON_2

28

Abbreviation for the second month of the year (Feb)

ABMON_3

29

Abbreviation for the third month of the year (Mar)

ABMON_4

30

Abbreviation for the fourth month of the year (Apr)

ABMON_5

31

Abbreviation for the fifth month of the year (May)

ABMON_6

32

Abbreviation for the sixth month of the year (Jun)

ABMON_7

33

Abbreviation for the seventh month of the year (Jul)

ABMON_8

34

Abbreviation for the eighth month of the year (Aug)

ABMON_9

35

Abbreviation for the ninth month of the year (Sep)

ABMON_10

36

Abbreviation for the tenth month of the year (Oct)

ABMON_11

37

Abbreviation for the eleventh month of the year (Nov)

ABMON_12

38

Abbreviation for the twelfth month of the year (Dec)

RADIXCHAR

39

Not supported. Radix character.

THOUSEP

40

Separator for thousands

CRNCYSTR

43

Currency symbol

D_T_FMT

44

String for formatting date and time

D_FMT

45

Date format

T_FMT

46

Time format

AM_STR

47

AM string

PM_STR

48

PM string

CODESET

49

Codeset name

T_FMT_AMPM

50

Not supported. AM or PM time format string.

ERA

51

Not supported. Era description segments

ERA_D_FMT

52

Not supported. Era date format string.

ERA_D_T_FMT

53

Not supported. Era date and time format string.

ERA_T_FMT

54

Not supported. Era time format string.

ALT_DIGITS

55

Not supported. Alternative symbol for digits.

See Also

setlocale