[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    conv(3C) manual page Table of Contents

Name

conv, toupper, tolower, _toupper, _tolower, toascii - translate characters

Synopsis

#include <ctype.h>

int toupper(int c);

int tolower(int c);

int _toupper(int c);

int _tolower(int c);

int toascii(int c);

MT-Level

MT-Safe with exceptions

Description

toupper() and tolower() have as their domain the range of the function getc(): all values represented in an unsigned char and the value of the macro EOF as defined in stdio.h. If the argument of toupper() represents a lower-case letter, the result is the corresponding upper-case letter. If the argument of tolower() represents an upper-case letter, the result is the corresponding lower-case letter. All other arguments in the domain are returned unchanged.

The macros _toupper() and _tolower() accomplish the same things as toupper() and tolower(), respectively, but have restricted domains and are faster. _toupper() requires a lower-case letter as its argument; its result is the corresponding upper-case letter. _tolower() requires an upper-case letter as its argument; its result is the corresponding lower-case letter. Arguments outside the domain cause undefined results.

toascii() yields its argument with all bits turned off that are not part of a standard 7-bit ASCII character; it is intended for compatibility with other systems.

toupper(), tolower(), _toupper(), and _tolower() are affected by LC_CTYPE . In the ‘C’ locale, or in a locale where shift information is not defined, these functions determine the case of characters according to the rules of the ASCII -coded character set. Characters outside the ASCII range of characters are returned unchanged.

See Also

ctype(3C) , setlocale(3C) , getc(3S) , environ(5)

Notes

toupper, tolower, _toupper, _tolower and toascii can be used safely in a multi-thread application, as long as setlocale(3C) is not being called to change the locale.


Table of Contents