std::towctrans
提供: cppreference.com
|
|
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
| Defined in header <cwctype>
|
||
| std::wint_t towctrans( std::wint_t wc, std::wctrans_t desc ); |
||
マップワイド文字
wcdescによって識別現在のCのロケールのLC_CTYPEカテゴリのマッピングを使用して.Original:
Maps the wide character
wc using the current C locale's LC_CTYPE mapping category identified by desc.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] パラメータ
| ch | - | マップへのワイド文字
Original: the wide character to map The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| desc | - | std::wctrans呼び出しで得られLC_CTYPEマッピング
Original: the LC_CTYPE mapping, obtained from a call to std::wctrans The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[編集] 値を返します
現在のCのロケールのLC_CTYPEファセットに
chによって識別マッピングを使用してdescのマッピングされた値.Original:
The mapped value of
ch using the mapping identified by desc in LC_CTYPE facet of the current C locale.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
次の例では、ひらがな文字へのマッピングはカタカナを示しています
Original:
The following example demonstrates katakana to hiragana character mapping
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
このコードを実行します
#include <clocale> #include <cwctype> #include <iostream> #include <algorithm> std::wstring tohira(std::wstring str) { std::transform(str.begin(), str.end(), str.begin(), [](wchar_t c) { return std::towctrans(c, std::wctrans("tojhira")); }); return str; } int main() { std::setlocale(LC_ALL, "ja_JP.UTF-8"); std::wstring kana = L"ヒラガナ"; std::wcout << "katakana characters " << kana << " are " << tohira(kana) << " in hiragana\n"; }
出力:
katakana characters ヒラガナ are ひらがな in hiragana
[編集] 参照
| 現在のCロケールで文字マッピングカテゴリを検索します Original: looks up a character mapping category in the current C locale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数) | |
| C documentation for towctrans
| |

