Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      towctrans

      From cppreference.com
      <c‎ |string‎ |wide
       
       
       
      Null-terminated wide strings
       
      Defined in header<wctype.h>
      wint_t towctrans( wint_t wc, wctrans_t desc);
      (since C95)

      Maps the wide characterwc using the current C locale'sLC_CTYPE mapping category identified bydesc.

      Contents

      [edit]Parameters

      wc - the wide character to map
      desc - theLC_CTYPE mapping, obtained from a call towctrans

      [edit]Return value

      The mapped value ofwc using the mapping identified bydesc inLC_CTYPE facet of the current C locale.

      [edit]Example

      Run this code
      #include <locale.h>#include <wctype.h>#include <wchar.h>#include <stdio.h> int main(void){setlocale(LC_ALL,"ja_JP.UTF-8");constwchar_t kana[]= L"ヒラガナ";size_t sz=sizeof kana/sizeof*kana;wchar_t hira[sz];for(size_t n=0; n< sz;++n)        hira[n]= towctrans(kana[n],wctrans("tojhira"));printf("katakana characters %ls are %ls in hiragana\n", kana, hira);}

      Output:

      katakana characters ヒラガナ are ひらがな in hiragana

      [edit]References

      • C23 standard (ISO/IEC 9899:2024):
      • 7.30.3.2.1 The towctrans function (p: TBD)
      • C17 standard (ISO/IEC 9899:2018):
      • 7.30.3.2.1 The towctrans function (p: TBD)
      • C11 standard (ISO/IEC 9899:2011):
      • 7.30.3.2.1 The towctrans function (p: 454)
      • C99 standard (ISO/IEC 9899:1999):
      • 7.25.3.2,1 The towctrans function (p: 400)

      [edit]See also

      (C95)
      looks up a character mapping category in the current C locale
      (function)[edit]
      C++ documentation fortowctrans
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=c/string/wide/towctrans&oldid=153714"

      [8]ページ先頭

      ©2009-2025 Movatter.jp