Skip to content

Commit 83e44bf

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 3caaa9a commit 83e44bf

File tree

4 files changed

+1841
-310
lines changed

4 files changed

+1841
-310
lines changed

lang/cpp11/char16_32.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@
188188

189189
<p class="text-right"><small>
190190
最終更新日時(UTC):
191-
<span itemprop="datePublished" content="2024-07-08T07:33:21">
192-
2024年07月08日 07時33分21秒
191+
<span itemprop="datePublished" content="2024-07-27T07:23:15">
192+
2024年07月27日 07時23分15秒
193193
</span>
194194
<br/>
195195
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
196-
<span itemprop="name">Akira Takahashi</span>
196+
<span itemprop="name">koile</span>
197197
</span>
198198
が更新
199199
</small></p>
@@ -255,8 +255,8 @@ <h3>char16_t型、char32_t型の文字・文字列リテラルと文字コード
255255
</ul>
256256
</li>
257257
<li><code>char16_t</code><code>char32_t</code>はそれぞれ、<code><a href="../../reference/cstdint.html">&lt;cstdint&gt;</a></code>ヘッダで定義される<code><a href="../../reference/cstdint/uint_least16_t.html">uint_least16_t</a></code><code><a href="../../reference/cstdint/uint_least32_t.html">uint_least32_t</a></code>と、サイズ、符号の有無、アライメントが同じである。</li>
258-
<li><code>&lt;uchar&gt;</code>ヘッダでマクロ<code>__STDC_UTF_16__</code>が定義される場合、<code>char16_t</code>型の値はUTF-16の妥当なコードポイントを持つ。そうでない場合、<code>char16_t</code>型の値は<a class="cpprefjp-defined-word" data-desc="処理系定義の動作。処理系によって事前に定めた動作をする" href="../../implementation-compliance.html#dfn-implementation-defined-behavior">実装定義</a>の文字コードとなる。</li>
259-
<li><code>&lt;uchar&gt;</code>ヘッダでマクロ<code>__STDC_UTF_32__</code>が定義される場合、<code>char32_t</code>型の値はUTF-32の妥当なコードポイントを持つ。そうでない場合、<code>char32_t</code>型の値は<a class="cpprefjp-defined-word" data-desc="処理系定義の動作。処理系によって事前に定めた動作をする" href="../../implementation-compliance.html#dfn-implementation-defined-behavior">実装定義</a>の文字コードとなる。</li>
258+
<li><code>&lt;cuchar&gt;</code>ヘッダでマクロ<code>__STDC_UTF_16__</code>が定義される場合、<code>char16_t</code>型の値はUTF-16の妥当なコードポイントを持つ。そうでない場合、<code>char16_t</code>型の値は<a class="cpprefjp-defined-word" data-desc="処理系定義の動作。処理系によって事前に定めた動作をする" href="../../implementation-compliance.html#dfn-implementation-defined-behavior">実装定義</a>の文字コードとなる。</li>
259+
<li><code>&lt;cuchar&gt;</code>ヘッダでマクロ<code>__STDC_UTF_32__</code>が定義される場合、<code>char32_t</code>型の値はUTF-32の妥当なコードポイントを持つ。そうでない場合、<code>char32_t</code>型の値は<a class="cpprefjp-defined-word" data-desc="処理系定義の動作。処理系によって事前に定めた動作をする" href="../../implementation-compliance.html#dfn-implementation-defined-behavior">実装定義</a>の文字コードとなる。</li>
260260
</ul>
261261
<h3>ユニバーサルキャラクタ名</h3>
262262
<ul>

lang/cpp20/make_char16t_char32t_string_literals_be_utf16_32.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@
188188

189189
<p class="text-right"><small>
190190
最終更新日時(UTC):
191-
<span itemprop="datePublished" content="2024-07-08T07:33:21">
192-
2024年07月08日 07時33分21秒
191+
<span itemprop="datePublished" content="2024-07-27T07:23:15">
192+
2024年07月27日 07時23分15秒
193193
</span>
194194
<br/>
195195
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
196-
<span itemprop="name">Akira Takahashi</span>
196+
<span itemprop="name">koile</span>
197197
</span>
198198
が更新
199199
</small></p>
@@ -221,13 +221,13 @@ <h2>概要</h2>
221221
<p>C++11で追加された文字型<a href="../cpp11/char16_32.html"><code>char16_t</code><code>char32_t</code></a>の文字・文字列リテラルの文字コード、C++20からはUTF-16とUTF-32であることが規定される。</p>
222222
<p>これまでは、以下のような仕様であった:</p>
223223
<ul>
224-
<li><code>&lt;uchar&gt;</code>ヘッダでマクロ<code>__STDC_UTF_16__</code>が定義される場合、<code>char16_t</code>型の値はUTF-16の妥当なコードポイントを持つ。そうでない場合、<code>char16_t</code>型の値は<a class="cpprefjp-defined-word" data-desc="処理系定義の動作。処理系によって事前に定めた動作をする" href="../../implementation-compliance.html#dfn-implementation-defined-behavior">実装定義</a>の文字コードとなる。</li>
225-
<li><code>&lt;uchar&gt;</code>ヘッダでマクロ<code>__STDC_UTF_32__</code>が定義される場合、<code>char32_t</code>型の値はUTF-32の妥当なコードポイントを持つ。そうでない場合、<code>char32_t</code>型の値は<a class="cpprefjp-defined-word" data-desc="処理系定義の動作。処理系によって事前に定めた動作をする" href="../../implementation-compliance.html#dfn-implementation-defined-behavior">実装定義</a>の文字コードとなる。</li>
224+
<li><code>&lt;cuchar&gt;</code>ヘッダでマクロ<code>__STDC_UTF_16__</code>が定義される場合、<code>char16_t</code>型の値はUTF-16の妥当なコードポイントを持つ。そうでない場合、<code>char16_t</code>型の値は<a class="cpprefjp-defined-word" data-desc="処理系定義の動作。処理系によって事前に定めた動作をする" href="../../implementation-compliance.html#dfn-implementation-defined-behavior">実装定義</a>の文字コードとなる。</li>
225+
<li><code>&lt;cuchar&gt;</code>ヘッダでマクロ<code>__STDC_UTF_32__</code>が定義される場合、<code>char32_t</code>型の値はUTF-32の妥当なコードポイントを持つ。そうでない場合、<code>char32_t</code>型の値は<a class="cpprefjp-defined-word" data-desc="処理系定義の動作。処理系によって事前に定めた動作をする" href="../../implementation-compliance.html#dfn-implementation-defined-behavior">実装定義</a>の文字コードとなる。</li>
226226
</ul>
227227
<p>C++20では、無条件にUTF-16とUTF-32であることが規定される。</p>
228228
<p>なお、<code>u8</code>プレフィックスをつけた文字・文字列リテラルは、UTF-8であることがこれまでに規定されていた。</p>
229229
<h2>この機能が必要になった背景・経緯</h2>
230-
<p>これまで、<code>&lt;uchar&gt;</code>ヘッダのマクロ<code>__STDC_UTF_16__</code><code>__STDC_UTF_32__</code>が定義されている場合にのみ、<code>char16_t</code><code>char32_t</code>はUTF-16/UTF-32エンコーディングであると規定されていた。</p>
230+
<p>これまで、<code>&lt;cuchar&gt;</code>ヘッダのマクロ<code>__STDC_UTF_16__</code><code>__STDC_UTF_32__</code>が定義されている場合にのみ、<code>char16_t</code><code>char32_t</code>はUTF-16/UTF-32エンコーディングであると規定されていた。</p>
231231
<p>しかし、これらが定義されなかった場合にコンパイラがほかのエンコーディングを選択することが疑わしかった。また、<code>char16_t</code>の仕様として「サロゲートペア」が含まれているが、その概念をもつ他のよく知られた文字コードはない。単一の文字を32ビットで表現する他のよく知られた文字コードもない。</p>
232232
<p>実際にはすべての実装でこれらの文字・文字列リテラルはUTF-16とUTF-32にエンコーディングされるため、要件を示すだけではなく、より明確にするために、<code>char16_t</code><code>char32_t</code>の文字・文字列リテラルがUTF-16とUTF-32文字コードであることを規定する。</p>
233233
<h2><a href="#relative-page" id="relative-page">関連項目</a></h2>

0 commit comments

Comments
 (0)