Null-terminated multibyte strings
提供: cppreference.com
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
NULLで終わるマルチバイト文字列(NTMBS)、または "マルチバイト文字列"とは、値ゼロを持つバイト(終端のNULL文字)が続くゼロ以外のバイトのシーケンスです.
Original:
A null-terminated multibyte string (NTMBS), or "multibyte string", is a sequence of nonzero bytes followed by a byte with value zero (the terminating null character).
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.
文字列に格納された各文字は1バイト以上を占有することができる。マルチバイト文字列内の文字を表すために使用されるエンコードはロケール固有である:それは例えば、UTF-8、GB18030、EUC-JP、シフトJIS、等であるかもしれない、char配列{'\xe4','\xbd','\xa0','\xe5','\xa5','\xbd','\0'}は文字列を保持NTMBSです"你好" UTF-8マルチバイトエンコーディングで:最初の3バイトは、文字你をエンコードすると、次の3バイトには文字好をエンコードします。 GB18030でエンコードされたものと同じ文字列は2文字の各々は2バイトシーケンスとしてエンコードされるchar配列{'\xc4', '\xe3', '\xba', '\xc3', '\0'}、です.
Original:
Each character stored in the string may occupy more than one byte. The encoding used to represent characters in a multibyte character string is locale-specific: it may be UTF-8, GB18030, EUC-JP, Shift-JIS, etc. For example, the char array {'\xe4','\xbd','\xa0','\xe5','\xa5','\xbd','\0'} is an NTMBS holding the string "你好" in UTF-8 multibyte encoding: the first three bytes encode the character 你, the next three bytes encode the character 好. The same string encoded in GB18030 is the char array {'\xc4', '\xe3', '\xba', '\xc3', '\0'}, where each of the two characters is encoded as a two-byte sequence.
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.
一部のマルチバイトエンコーディングでは、任意のマルチバイト文字シーケンスは、 "shift配列"として知られている前のバイト·シーケンスに応じて異なる文字を表すことがあります。このようなエンコーディングが状態依存として知られています:現在のシフト状態の知識は、各文字を解釈するために必要です。それは初期シフト状態で開始および終了する場合NTMBSにのみ有効です。シフトシーケンスが使用された場合、対応したunshift配列は終端のヌル文字の前に存在する必要があります。このようなエンコーディングの例としては、7ビットJIS、BOCU-1とSCSUです.
Original:
In some multibyte encodings, any given multibyte character sequence may represent different characters depending on the previous byte sequences, known as "shift sequences". Such encodings are known as state-dependent: knowledge of the current shift state is required to interpret each character. An NTMBS is only valid if it begins and ends in the initial shift state: if a shift sequence was used, the corresponding unshift sequence has to be present before the terminating null character. Examples of such encodings are the 7-bit JIS, BOCU-1 and SCSU.
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.
マルチバイト文字列はNULL終端バイト文字列(NTBS)とのレイアウト互換性があり、保存されてコピーされ、文字の数を計算する場合を除き、同じ機能を使用して調べることができます。正しいロケールが有効になっている場合、I / O機能にもマルチバイト文字列を扱う。マルチバイト文字列はstd::codecvtのメンバ関数、std::wstring_convert、または次のロケール依存の変換関数を使用してワイド文字列との間で変換することができます
Original:
A multibyte character string is layout-compatible with null-terminated byte string (NTBS), that is, can be stored, copied, and examined using the same facilities, except for calculating the number of characters. If the correct locale is in effect, I/O functions also handle multibyte strings. Multibyte strings can be converted to and from wide strings using the std::codecvt member functions, std::wstring_convert, or the following locale-dependent conversion functions:
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.
マルチバイト/ワイド文字変換
ヘッダ
<cstdlib> で定義 | |
次のマルチバイト文字のバイト数を返します (関数) | |
次のマルチバイト文字をワイド文字に変換します (関数) | |
ワイド文字をマルチバイト表現に変換します (関数) | |
マルチバイト文字列をワイド文字列に変換します (関数) | |
ワイド文字列をマルチバイト文字列に変換します (関数) | |
ヘッダ
<cwchar> で定義 | |
mbstate_t オブジェクトが初期シフト状態を表しているかどうかチェックします (関数) | |
可能であればシングルバイト文字をワイド文字に変換します (関数) | |
可能であればワイド文字をシングルバイト文字に変換します (関数) | |
指定された状態を使用して次のマルチバイト文字のバイト数を返します (関数) | |
指定された状態を使用して次のマルチバイト文字をワイド文字に変換します (関数) | |
指定された状態を使用してワイド文字をマルチバイト表現に変換します (関数) | |
指定された状態を使用してマルチバイト文字列をワイド文字列に変換します (関数) | |
指定された状態を使用してワイド文字列をマルチバイト文字列に変換します (関数) | |
ヘッダ
<cuchar> で定義 | |
(C++11) |
ナローマルチバイト文字を UTF-16 エンコーディングに変換します (関数) |
(C++11) |
16ビットワイド文字をマルチバイト文字列に変換します (関数) |
(C++11) |
ナローマルチバイト文字を UTF-32 エンコーディングに変換します (関数) |
(C++11) |
32ビットワイド文字をマルチバイト文字列に変換します (関数) |
タイプ
ヘッダ
<cwchar> で定義 | |
マルチバイト文字列を反復処理するために必要な変換状態情報 (クラス) |
マクロ
ヘッダ
<climits> で定義 | |
MB_LEN_MAX |
マルチバイト文字1文字の最大バイト数 (マクロ定数) |
ヘッダ
<cstdlib> で定義 | |
MB_CUR_MAX |
現在のCのロケールにおけるマルチバイト文字1文字の最大文字数 (macro variable) |
ヘッダ
<cuchar> で定義 | |
__STDC_UTF_16__ |
そのUTF-16のエンコーディングがmbrtoc16とc16rtombによって使用されていることを示します Original: indicates that UTF-16 encoding is used by mbrtoc16 and c16rtomb The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (マクロ定数) |
__STDC_UTF_32__ |
そのUTF-32のエンコーディングがmbrtoc32とc32rtombによって使用されていることを示します Original: indicates that UTF-32 encoding is used by mbrtoc32 and c32rtomb The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (マクロ定数) |