File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Original file line number Diff line number Diff 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 > 更新时间:2024年11月26日 12:26:35  (UTC+08:00)</ p > 
295+ < p > 更新时间:2024年11月26日 12:32:42  (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 > 
Original file line number Diff line number Diff 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>更新时间:2024年11月26日 12:26:35  (UTC+08:00)</p>
424+ <p>更新时间:2024年11月26日 12:32:42  (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>
@@ -18357,11 +18357,13 @@ <h3 id="unicode-utf-8_4">UTF-8 派的跨平台软件何去何从?</h3>
1835718357    setlocale(LC_ALL, ".utf-8");  // 设置标准库调用系统 API 所用的编码,用于 fopen,ifstream 等函数
1835818358    SetConsoleOutputCP(CP_UTF8); // 设置控制台输出编码,或者写 system("chcp 65001") 也行,这里 CP_UTF8 = 65001
1835918359    SetConsoleCP(CP_UTF8); // 设置控制台输入编码,用于 std::cin
18360+ #elif __APPLE__
18361+     // 通常来说 MacOS 的默认编码就是 UTF-8,这里设置全局 locale 是为了让 iswspace 接受全角空格、iswpunct 接受全角逗号 L',' 等
18362+     setlocale(LC_ALL, "UTF-8");  // MacOS 设置 UTF-8 编码,让 iswspace 接受全角空格等
1836018363#elif __unix__
1836118364    // 反正 Unix 系统默认都是 UTF-8,不设置也行,这里设置全局 locale 是为了让 iswspace 接受全角空格、iswpunct 接受全角逗号 L',' 等
1836218365    //setlocale(LC_ALL, "zh_CN.utf-8"); // 设置使用中文本地化,可使 strerror 输出中文(但用户必须 locale-gen 过中文!)
18363-     //setlocale(LC_ALL, "C.utf-8");     // 设置使用语言中性 locale,只影响 iswspace、iswpunct 等函数,不会使 strerror 等输出中文
18364-     setlocale(LC_ALL, ".utf-8");        // 若不带任何前缀(推荐),则默认使用当前系统环境变量中的语言 $LANG,使 strerror 自动适应
18366+     setlocale(LC_ALL, "C.utf-8");       // 设置使用语言中性 locale(推荐),只影响 iswspace、iswpunct 等函数,不会使 strerror 等输出中文
1836518367#endif
1836618368    // 这里开始写你的主程序吧!
1836718369    // ...
  Load Diff Large diffs are not rendered by default. 
Original file line number Diff line number Diff line change @@ -3066,11 +3066,13 @@ <h3 id="utf-8_4">UTF-8 派的跨平台软件何去何从?</h3>
30663066    setlocale(LC_ALL, ".utf-8");  // 设置标准库调用系统 API 所用的编码,用于 fopen,ifstream 等函数
30673067    SetConsoleOutputCP(CP_UTF8); // 设置控制台输出编码,或者写 system("chcp 65001") 也行,这里 CP_UTF8 = 65001
30683068    SetConsoleCP(CP_UTF8); // 设置控制台输入编码,用于 std::cin
3069+ #elif __APPLE__
3070+     // 通常来说 MacOS 的默认编码就是 UTF-8,这里设置全局 locale 是为了让 iswspace 接受全角空格、iswpunct 接受全角逗号 L',' 等
3071+     setlocale(LC_ALL, "UTF-8");  // MacOS 设置 UTF-8 编码,让 iswspace 接受全角空格等
30693072#elif __unix__
30703073    // 反正 Unix 系统默认都是 UTF-8,不设置也行,这里设置全局 locale 是为了让 iswspace 接受全角空格、iswpunct 接受全角逗号 L',' 等
30713074    //setlocale(LC_ALL, "zh_CN.utf-8"); // 设置使用中文本地化,可使 strerror 输出中文(但用户必须 locale-gen 过中文!)
3072-     //setlocale(LC_ALL, "C.utf-8");     // 设置使用语言中性 locale,只影响 iswspace、iswpunct 等函数,不会使 strerror 等输出中文
3073-     setlocale(LC_ALL, ".utf-8");        // 若不带任何前缀(推荐),则默认使用当前系统环境变量中的语言 $LANG,使 strerror 自动适应
3075+     setlocale(LC_ALL, "C.utf-8");       // 设置使用语言中性 locale(推荐),只影响 iswspace、iswpunct 等函数,不会使 strerror 等输出中文
30743076#endif
30753077    // 这里开始写你的主程序吧!
30763078    // ...
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments