towlower
From cppreference.com
| ヘッダ <wctype.h> で定義 |
||
| wint_t towlower( wint_t wc ); |
(C95 以降) | |
指定されたワイド文字を、可能な場合に小文字に変換します。
目次 |
[編集] パラメータ
| wc | - | 変換するワイド文字 |
[編集] 戻り値
wc の小文字バージョン、または現在の C ロケールで小文字バージョンが定義されていない場合は、変更されない wc。
[編集] 注意
この関数で実行できるのは 1対1 の文字マッピングのみです。例えば、ギリシャ語の大文字 ''Σ'' には、単語内の位置によって 2 つの小文字の形式 ('σ' と 'ς') があります。towlower の呼び出しでは、この場合の正しい小文字の形式を得ることはできません。
ISO 30112 は、Unicode 文字のどのペアがこのマッピングに含まれるかを規定しています。
[編集] 例
このコードを実行
#include <locale.h> #include <stdio.h> #include <wchar.h> #include <wctype.h> int main(void) { wchar_t wc = L'\u0190'; // Latin capital open E ('Ɛ') printf("in the default locale, towlower(%#x) = %#x\n", wc, towlower(wc)); setlocale(LC_ALL, "en_US.utf8"); printf("in Unicode locale, towlower(%#x) = %#x\n", wc, towlower(wc)); }
出力
in the default locale, towlower(0x190) = 0x190 in Unicode locale, towlower(0x190) = 0x25b
[編集] 参照
- C23標準 (ISO/IEC 9899:2024)
- 7.30.3.1.1 The towlower function (p: TBD)
- C17標準 (ISO/IEC 9899:2018)
- 7.30.3.1.1 The towlower function (p: TBD)
- C11標準 (ISO/IEC 9899:2011)
- 7.30.3.1.1 The towlower function (p: 453)
- C99標準 (ISO/IEC 9899:1999)
- 7.25.3.1.1 The towlower function (p: 399)
[編集] 関連項目
| (C95) |
ワイド文字を大文字に変換する (関数) |
| 文字を小文字に変換する (関数) | |
| C++ ドキュメント for towlower
| |