Middleware, development tools, realtime operating system
software and services for superior embedded design


Home
QNX Community Resources
Developer Support
QNX Documentation Library
QNX Developer Support

QNX Developer Support

QNX Software Systems
Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation
Technical Articles

[Previous] [Contents] [Index] [Next]

setlocale()

Select a program's locale

Synopsis:

#include <locale.h>

char * setlocale( int category, 
                  const char * locale );

Arguments:

category
The part of the environment that you want to set; one of:
  • LC_ALL -- select the entire locale environment.
  • LC_COLLATE -- select only the collating sequence.
  • LC_CTYPE -- select only the character-handling information.
  • LC_MESSAGES -- specify the language to be used for messages.
  • LC_MONETARY -- select only monetary formatting information.
  • LC_NUMERIC -- select only the numeric-format environment.
  • LC_TIME -- select only the time-related environment.
locale
The locale that you want to use. The following built-in locales are offered:
  • C (default)
  • C-TRADITIONAL
  • POSIX

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The setlocale() function selects a program's locale, according to the specified category and the specified locale.

A locale affects several things:

See the localeconv() function for more information about the locale.

At the start of a program, the default C locale is initialized as if the following call to setlocale() appeared at the start of main():

(void)setlocale( LC_ALL, "C" );

Returns:

A pointer to a system-generated string indicating the previous locale, or NULL if an error occurs.

Classification:

ANSI, POSIX 1003.1

Safety:
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes

See also:

isalpha(), isascii(), localeconv(), printf(), scanf(), strcat(), strchr(), strcmp(), strcoll(), strcpy(), strftime(), strlen(), strpbrk(), strspn(), strtod(), strtok(), strxfrm(), tm


[Previous] [Contents] [Index] [Next]