Scroll to navigation

toupper(3) Library Functions Manual toupper(3)

NOMBRE

toupper, tolower, toupper_1, tolower_1 - convierten letras a mayúsculas o minúsculas

BIBLIOTECA

Biblioteca Estándar C (libc, -lc)

SINOPSIS

#include <ctype.h>
int toupper(int c);
int tolower(int c);
int toupper_l(int c, locale_t locale);
int tolower_l(int c, locale_t locale);

Requisitos de Macros de Prueba de Características para glibc (véase feature_test_macros(7)):

toupper_l(), tolower_l():


Desde glibc 2.10:
_XOPEN_SOURCE >= 700
Antes de glibc 2.10:
_GNU_SOURCE

DESCRIPCIÓN

Estas funciones convierten minúsculas a mayúsculas y viceversa.

If c is a lowercase letter, toupper() returns its uppercase equivalent, if an uppercase representation exists in the current locale. Otherwise, it returns c. The toupper_l() function performs the same task, but uses the locale referred to by the locale handle locale.

If c is an uppercase letter, tolower() returns its lowercase equivalent, if a lowercase representation exists in the current locale. Otherwise, it returns c. The tolower_l() function performs the same task, but uses the locale referred to by the locale handle locale.

If c is neither an unsigned char value nor EOF, the behavior of these functions is undefined.

The behavior of toupper_l() and tolower_l() is undefined if locale is the special locale object LC_GLOBAL_LOCALE (see duplocale(3)) or is not a valid locale object handle.

VALOR DEVUELTO

El valor devuelto es la letra "convertida", o c si no se pudo realizar la conversión.

ATRIBUTOS

Para obtener una explicación de los términos usados en esta sección, véase attributes(7).

Interfaz Atributo Valor
toupper(), tolower(), toupper_l(), tolower_l() Seguridad del hilo Multi-hilo seguro

ESTÁNDARES

toupper(), tolower(): C99, 4.3BSD, POSIX.1-2001, POSIX.1-2008.

toupper_l(), tolower_l(): POSIX.1-2008.

NOTAS

The standards require that the argument c for these functions is either EOF or a value that is representable in the type unsigned char. If the argument c is of type char, it must be cast to unsigned char, as in the following example:


char c;
...
res = toupper((unsigned char) c);

This is necessary because char may be the equivalent signed char, in which case a byte where the top bit is set would be sign extended when converting to int, yielding a value that is outside the range of unsigned char.

Hay que tener en cuenta que los detalles de qué es mayúscula o minúscula dependen de cada lengua. Por ejemplo, en la localización "C" por omisión no existe la letra "umlaut", por lo que no se le aplica conversión.

En algunas localizaciones no inglesas existen letras minúsculas que no tienen su correspondiente letra mayúscula; por ejemplo la s aguda alemana.

VÉASE TAMBIÉN

isalpha(3), newlocale(3), setlocale(3), towlower(3), towupper(3), uselocale(3), locale(7)

TRADUCCIÓN

La traducción al español de esta página del manual fue creada por Miguel Pérez Ibars <mpi79470@alu.um.es> y Marcos Fouces <marcos@debian.org>

Esta traducción es documentación libre; lea la GNU General Public License Version 3 o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD.

Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a debian-l10n-spanish@lists.debian.org.

29 Diciembre 2022 Páginas de manual de Linux 6.03