.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" and Copyright 2014 Michael Kerrisk .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Modified Sat Jul 24 17:45:39 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 2000-02-13 by Nicolás Lichtmaier .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 Ueyama Rui and HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Fri Aug 29 19:47:32 JST 1997 .\" by Ueyama Rui .\" by HIROFUMI Nishizuka .\" Translated Sun Mar 12 21:42:31 JST 2000 .\" by HANATAKA Shinya .\" .TH TOUPPER 3 2017\-09\-15 GNU "Linux Programmer's Manual" .SH 名前 toupper, tolower, toupper_l, tolower_l \- 小文字を大文字にする。または大文字を小文字にする。 .SH 書式 .nf \fB#include \fP .PP \fBint toupper(int \fP\fIc\fP\fB);\fP \fBint tolower(int \fP\fIc\fP\fB);\fP .PP \fBint toupper_l(int \fP\fIc\fP\fB, locale_t \fP\fIlocale\fP\fB);\fP \fBint tolower_l(int \fP\fIc\fP\fB, locale_t \fP\fIlocale\fP\fB);\fP .fi .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP \fBtoupper_l\fP(), \fBtolower_l\fP(): .PD 0 .RS 4 .TP glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 .TP glibc 2.10 より前: _GNU_SOURCE .RE .PD .SH 説明 これらの関数は、小文字を大文字に、もしくは大文字を小文字に変換する。 .PP \fIc\fP が小文字の場合、現在のロケールで大文字表現が存在する場合、 \fBtoupper\fP() は対応する大文字を返す。大文字表現が存在しない場合、\fIc\fP を返す。 \fBtoupper_l\fP() 関数は同じ動作をするが、ロケールハンドル \fIlocale\fP が参照するロケールを使って変換を行う。 .PP If \fIc\fP is an uppercase letter, \fBtolower\fP() returns its lowercase equivalent, if a lowercase representation exists in the current locale. Otherwise, it returns \fIc\fP. The \fBtolower_l\fP() function performs the same task, but uses the locale referred to by the locale handle \fIlocale\fP. .PP もし \fIc\fP が \fIunsigned char\fP 値でも \fBEOF\fP でもない場合、これらの関数の動作は未定義である。 .PP \fIlocale\fP が特別なロケールオブジェクト \fBLC_GLOBAL_LOCALE\fP の場合 (\fBduplocale\fP(3) 参照)、または \fIlocale\fP が有効なロケールオブジェクトハンドルでない場合、 \fBtoupper_l\fP() と \fBtolower_l\fP() の動作は未定義である。 .SH 返り値 変換ができれば変換後の文字を返す。できなければ変換前の \fIc\fP を返す。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lbw24 lb lb l l l. インターフェース 属性 値 T{ \fBtoupper\fP(), \fBtolower\fP(), .br \fBtoupper_l\fP(), \fBtolower_l\fP() T} Thread safety MT\-Safe .TE .SH 準拠 \fBtoupper\fP(), \fBtolower\fP(): C89, C99, 4.3BSD, POSIX.1\-2001, POSIX.1\-2008. .PP \fBtoupper_l\fP(), \fBtolower_l\fP(): POSIX.1\-2008. .SH 注意 The standards require that the argument \fIc\fP for these functions is either \fBEOF\fP or a value that is representable in the type \fIunsigned char\fP. If the argument \fIc\fP is of type \fIchar\fP, it must be cast to \fIunsigned char\fP, as in the following example: .PP .in +4n .EX char c; \&... res = toupper((unsigned char) c); .EE .in .PP This is necessary because \fIchar\fP may be the equivalent \fIsigned char\fP, in which case a byte where the top bit is set would be sign extended when converting to \fIint\fP, yielding a value that is outside the range of \fIunsigned char\fP. .PP なにが大文字でなにが小文字なのかということの詳細は、ロケールに依存している。たとえば、デフォルトの \fB"C"\fP ロケールではウムラウトを認識しないため、それらの文字は変換できない。 .PP .\" FIXME One day the statement about "sharp s" needs to be reworked, .\" since there is nowadays a capital "sharp s" that has a codepoint .\" in Unicode 5.0; see https://en.wikipedia.org/wiki/Capital_%E1%BA%9E いくつかの非英語ロケールでは、対応する大文字を持たない小文字が存在する。 ドイツ語のエスツェットが一つの例である。 .SH 関連項目 \fBisalpha\fP(3), \fBnewlocale\fP(3), \fBsetlocale\fP(3), \fBtowlower\fP(3), \fBtowupper\fP(3), \fBuselocale\fP(3), \fBlocale\fP(7) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。