Man page - tolower_l(3)

Packages contains this manual

Available languages:

en fr pl ja ro de

Manual

TOUPPER

名 前
書 式
説 明
返 り 値
属 性
準 拠
注 意
関 連 項 目
こ の 文 書 に つ い て

名 前

toupper, tolower, toupper_l, tolower_l - 小 文 字 を 大 文 字 に す る 。 ま た は 大 文 字 を 小 文 字 に す る 。

書 式

#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 );

glibc 向 け の 機 能 検 査 マ ク ロ の 要 件 ( feature_test_macros (7) 参 照 ):

toupper_l (), tolower_l ():

glibc 2.10 以 降 :

_XOPEN_SOURCE >= 700

glibc 2.10 よ り 前 :

_GNU_SOURCE

説 明

こ れ ら の 関 数 は 、 小 文 字 を 大 文 字 に 、 も し く は 大 文 字 を 小 文 字 に 変 換 す る 。

c が 小 文 字 の 場 合 、 現 在 の ロ ケ ー ル で 大 文 字 表 現 が 存 在 す る 場 合 、 toupper () は 対 応 す る 大 文 字 を 返 す 。 大 文 字 表 現 が 存 在 し な い 場 合 、 c を 返 す 。 toupper_l () 関 数 は 同 じ 動 作 を す る が 、 ロ ケ ー ル ハ ン ド ル 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 .

も し c unsigned char 値 で も EOF で も な い 場 合 、 こ れ ら の 関 数 の 動 作 は 未 定 義 で あ る 。

locale が 特 別 な ロ ケ ー ル オ ブ ジ ェ ク ト LC_GLOBAL_LOCALE の 場 合 ( duplocale (3) 参 照 )、 ま た は locale が 有 効 な ロ ケ ー ル オ ブ ジ ェ ク ト ハ ン ド ル で な い 場 合 、 toupper_l () と tolower_l () の 動 作 は 未 定 義 で あ る 。

返 り 値

変 換 が で き れ ば 変 換 後 の 文 字 を 返 す 。 で き な け れ ば 変 換 前 の c を 返 す 。

属 性

こ の 節 で 使 用 さ れ て い る 用 語 の 説 明 に つ い て は 、 attributes (7) を 参 照 。

Image grohtml-41072-1.png

準 拠

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

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

注 意

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 .

な に が 大 文 字 で な に が 小 文 字 な の か と い う こ と の 詳 細 は 、 ロ ケ ー ル に 依 存 し て い る 。 た と え ば 、 デ フ ォ ル ト の "C" ロ ケ ー ル で は ウ ム ラ ウ ト を 認 識 し な い た め 、 そ れ ら の 文 字 は 変 換 で き な い 。

い く つ か の 非 英 語 ロ ケ ー ル で は 、 対 応 す る 大 文 字 を 持 た な い 小 文 字 が 存 在 す る 。 ド イ ツ 語 の エ ス ツ ェ ッ ト が 一 つ の 例 で あ る 。

関 連 項 目

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

こ の 文 書 に つ い て

こ の man ペ ー ジ は Linux man-pages プ ロ ジ ェ ク ト の リ リ ー ス 5.10 の 一 部 で あ る 。 プ ロ ジ ェ ク ト の 説 明 と バ グ 報 告 に 関 す る 情 報 は https://www.kernel.org/doc/man-pages/ に 書 か れ て い る 。