locale


1. Set the Locale for the Current Thread

#include <locale.h>
int setlocale(int category, const char *locale);

Sets the locale for the specified category for the current thread.

2. Get the Current Locale

#include <locale.h>
char *setlocale(int category, const char *locale);

Returns the current locale for the specified category.

3. Convert a String to Uppercase

#include <locale.h>
char *strupr(char *s);

Converts the string s to uppercase.

4. Convert a String to Lowercase

#include <locale.h>
char *strlwr(char *s);

Converts the string s to lowercase.

5. Compare Two Strings Case-Insensitively

#include <locale.h>
int strcasecmp(const char *s1, const char *s2);

Compares the two strings s1 and s2 case-insensitively.

6. Copy a String

Copies the string src to the string dest.

7. Concatenate Two Strings

Concatenates the string src to the end of the string dest.

8. Get the Length of a String

Returns the length of the string s.

9. Find a Character in a String

Returns a pointer to the first occurrence of the character c in the string s.

10. Find the Last Occurrence of a Character in a String

Returns a pointer to the last occurrence of the character c in the string s.

11. Split a String into Tokens

Splits the string str into tokens based on the delimiter delim.

12. Convert a Number to a String

Converts the integer num to a string str in the specified radix radix.

13. Convert a String to a Number

Converts the string str to a long integer.

14. Format a Number

Formats the time specified by the tm structure according to the format string format.

15. Get the Current Time

Returns the current time as a time_t value.

16. Convert a Time_t Value to a String

Converts the time_t value tloc to a string.

17. Convert a String to a Time_t Value

Converts the tm structure to a time_t value.

18. Get the Current Date and Time

Gets the current date and time as a tm structure.

19. Set the Current Date and Time

Sets the current date and time from the time_t value tloc.

20. Get the Julian Day Number

Calculates the Julian day number for the given tm structure.

21. Get the Day of the Year

Returns the day of the year for the given tm structure.

22. Get the Day of the Week

Returns the day of the week for the given tm structure.

23. Get the Week of the Year

Returns the week of the year for the given tm structure.

24. Convert a Time Zone String to a Time Zone Structure

Converts the time zone string tloc to a tm structure.

25. Convert a Time Zone Structure to a Time Zone String

Converts the tm structure to a time zone string.

26. Get the Time Zone Offset

Returns the time zone offset in seconds from UTC.

27. Get the Daylight Savings Time Offset

Returns the daylight savings time offset in seconds from UTC.

28. Get the Current Character Set

Sets the current character set to the locale locale.

29. Get the Current Collation Order

Sets the current collation order to the locale locale.

30. Get the Current Monetary Format

Sets the current monetary format to the locale locale.

31. Get the Current Numeric Format

Sets the current numeric format to the locale locale.

32. Get the Current Time Format

Sets the current time format to the locale locale.

33. Get the Current Date Format

Sets the current date format to the locale locale.

34. Get the Current Measurement System

Sets the current measurement system to the locale locale.

35. Get the Current Paper Size

Sets the current paper size to the locale locale.

36. Get the Current Language

Sets the current language to the locale locale.

37. Get the Current Country

Sets the current country to the locale locale.

38. Get the Current Locale Name

Returns the name of the current locale.

39. Create a New Locale

Creates a new locale with the specified locale mask, locale, and base locale.

40. Destroy a Locale

Destroys the specified locale.

41. Duplicate a Locale

Duplicates the specified locale.

42. Get the Locale Categories

Returns the locale categories that are set in the specified locale mask.

43. Mask a Locale Category

Sets the locale category mask to the specified value.

44. Unmask a Locale Category

Unsets the locale category mask for the specified category.

45. Get the Locale Attributes

Returns the locale attributes for the specified locale.

46. Set the Locale Attributes

Sets the locale attributes for the specified locale.

47. Compare Two Locales

Compares two locales and returns 0 if they are equal.

48. Merge Two Locales

Merges two locales into a new locale.

49. Get the Locale Environment

Gets the locale environment for the specified category.

50. Set the Locale Environment

Sets the locale environment for the specified category.