Skip to content

Commit 4403e54

Browse files
committed
deploy: 665c61b
1 parent 60435de commit 4403e54

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ <h2 id="_1">前言</h2>
292292
<blockquote>
293293
<p><img src="./img/bulb.png" height="30px" width="auto" style="margin: 0; border: none"/> 本书还在持续更新中……要追番的话,可以在 <a href="https://github.com/parallel101/cppguidebook">GitHub</a> 点一下右上角的 “Watch” 按钮,每当小彭老师提交新 commit,GitHub 会向你发送一封电子邮件,提醒你小彭老师更新了。</p>
294294
</blockquote>
295-
<p>更新时间:2025年02月26日 10:10:17 (UTC+08:00)</p>
295+
<p>更新时间:2025年02月26日 10:11:15 (UTC+08:00)</p>
296296
<p><a href="https://parallel101.github.io/cppguidebook">在 GitHub Pages 浏览本书</a> | <a href="https://142857.red/book">在小彭老师自己维护的镜像上浏览本书</a></p>
297297
<h2 id="_2">格式约定</h2>
298298
<blockquote>

print_page/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ <h2 id="index-_1">前言</h2>
421421
<blockquote>
422422
<p><img src="../img/bulb.png" height="30px" width="auto" style="margin: 0; border: none"/> 本书还在持续更新中……要追番的话,可以在 <a href="https://github.com/parallel101/cppguidebook">GitHub</a> 点一下右上角的 “Watch” 按钮,每当小彭老师提交新 commit,GitHub 会向你发送一封电子邮件,提醒你小彭老师更新了。</p>
423423
</blockquote>
424-
<p>更新时间:2025年02月26日 10:10:17 (UTC+08:00)</p>
424+
<p>更新时间:2025年02月26日 10:11:15 (UTC+08:00)</p>
425425
<p><a href="https://parallel101.github.io/cppguidebook">在 GitHub Pages 浏览本书</a> | <a href="https://142857.red/book">在小彭老师自己维护的镜像上浏览本书</a></p>
426426
<h2 id="index-_2">格式约定</h2>
427427
<blockquote>
@@ -16933,12 +16933,12 @@ <h3 id="unicode-utf-8_2">UTF-8 确实几乎完美支持字符串所有操作</h3
1693316933
</blockquote>
1693416934
<p>UTF-8 无法取出单个非 ASCII 字符,对于单个中文字符,仍然只能以字符串形式表达(由多个字节组成)。</p>
1693516935
<pre><code class="language-cpp">std::string s = &quot;小彭老师公开课万岁&quot;;
16936-
fmt::print(&quot;UTF-8 下第一个字节:{}&quot;, s[0]);
16936+
fmt::println(&quot;UTF-8 下第一个字节:{}&quot;, s[0]);
1693716937
// 可能会打印 ‘å’ (0xE5),因为“小”的 UTF-8 编码是 0xE5 0xB0 0x8F
1693816938
// 也可能是乱码“�”,取决于终端理解的编码格式
1693916939
</code></pre>
1694016940
<pre><code class="language-cpp">std::u32string s = U&quot;小彭老师公开课万岁&quot;;
16941-
fmt::print(&quot;UTF-32 下第一个字符:{}&quot;, utf8::utf32to8(s.substr(0, 1)));
16941+
fmt::println(&quot;UTF-32 下第一个字符:{}&quot;, utf8::utf32to8(s.substr(0, 1)));
1694216942
// 会打印 ‘小’
1694316943
</code></pre>
1694416944
<p>UTF-8 字符串的反转也会出问题:</p>

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

unicode/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,12 +1211,12 @@ <h3 id="utf-8_2">UTF-8 确实几乎完美支持字符串所有操作</h3>
12111211
</blockquote>
12121212
<p>UTF-8 无法取出单个非 ASCII 字符,对于单个中文字符,仍然只能以字符串形式表达(由多个字节组成)。</p>
12131213
<pre><code class="language-cpp">std::string s = &quot;小彭老师公开课万岁&quot;;
1214-
fmt::print(&quot;UTF-8 下第一个字节:{}&quot;, s[0]);
1214+
fmt::println(&quot;UTF-8 下第一个字节:{}&quot;, s[0]);
12151215
// 可能会打印 ‘å’ (0xE5),因为“小”的 UTF-8 编码是 0xE5 0xB0 0x8F
12161216
// 也可能是乱码“�”,取决于终端理解的编码格式
12171217
</code></pre>
12181218
<pre><code class="language-cpp">std::u32string s = U&quot;小彭老师公开课万岁&quot;;
1219-
fmt::print(&quot;UTF-32 下第一个字符:{}&quot;, utf8::utf32to8(s.substr(0, 1)));
1219+
fmt::println(&quot;UTF-32 下第一个字符:{}&quot;, utf8::utf32to8(s.substr(0, 1)));
12201220
// 会打印 ‘小’
12211221
</code></pre>
12221222
<p>UTF-8 字符串的反转也会出问题:</p>

0 commit comments

Comments
 (0)