towupper
提供: cppreference.com
<tbody>
</tbody>
| ヘッダ <wctype.h> で定義
|
||
wint_t towupper( wint_t wc ); |
(C95以上) | |
指定されたワイド文字を可能であれば大文字に変換します。
引数
| wc | - | 変換されるワイド文字 |
戻り値
wc の大文字バージョン、または現在の C のロケールに大文字バージョンがなければ無変更の wc。
ノート
1:1 の文字マッピングのみがこの関数で行うことができます。 例えば、 'ß' の大文字形は (いくつか例外はあるものの) 2文字の文字列 "SS" であり、 towupper によって取得することはできません。
ISO 30112 はこのマッピングに含まれる Unicode 文字の組を規定しています。
例
Run this code
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
#include <locale.h>
int main(void)
{
wchar_t wc = L'\u017f'; // Latin small letter Long S ('ſ')
printf("in the default locale, towupper(%#x) = %#x\n", wc, towupper(wc));
setlocale(LC_ALL, "en_US.utf8");
printf("in Unicode locale, towupper(%#x) = %#x\n", wc, towupper(wc));
}
出力:
in the default locale, towupper(0x17f) = 0x17f
in Unicode locale, towupper(0x17f) = 0x53