名前空間
変種
操作

towupper

From cppreference.com
< c‎ | string‎ | wide
 
 
 
 
ヘッダ <wctype.h> で定義
wint_t towupper( wint_t wc );
(C95 以降)

指定されたワイド文字を、可能であれば大文字に変換します。

目次

[編集] パラメータ

wc - 変換するワイド文字

[編集] 戻り値

wc の大文字バージョン。現在の C ロケールで大文字バージョンが定義されていない場合は、`wc` は変更されません。

[編集] 注記

この関数では 1 対 1 の文字マッピングのみが可能です。例えば、'ß' の大文字は(例外はありますが)2 文字の文字列 "SS" ですが、これは towupper では得られません。

ISO 30112 には、このマッピングに含まれる Unicode 文字のペアが指定されています。

[編集]

#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

[編集] 参照

  • C11標準 (ISO/IEC 9899:2011)
  • 7.30.3.1.2 The towupper function (p: 453)
  • C99標準 (ISO/IEC 9899:1999)
  • 7.25.3.1.2 The towupper function (p: 399)

[編集] 関連項目

ワイド文字を小文字に変換する
(関数) [編集]
文字を大文字に変換する
(関数) [編集]
English 日本語 中文(简体) 中文(繁體)