We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 63f6c90 commit c4251c6Copy full SHA for c4251c6
docs/unicode.md
@@ -934,12 +934,14 @@ std::string s = u8"你好";
934
935
|前缀|编码|字符类型|
936
|----|----|--------|
937
-|"你好"|运行字符集 (ANSI)|`const char []`|
+|"你好"|运行字符集 (默认是开发者电脑的“区域设置”,而不是客户的)|`const char []`|
938
|L"你好"|Windows 上 UTF-16;Linux 上 UTF-32|`const wchar_t []`|
939
|u8"你好"|UTF-8|`const char8_t []`|
940
|u"你好"|UTF-16|`const char16_t []`|
941
|U"你好"|UTF-32|`const char32_t []`|
942
943
+> {{ icon.tip }} 只不过是开发者和客户往往处于同一个地区,所以 `"你好"` 看起来好像可以直接输入到 `std::cout` 中一样。实际上他只是开发者电脑的 ANSI,而不是客户电脑的 ANSI,如果直接拿来打印,会导致以 `""` 常量形式写死的字符串会在客户电脑上出现乱码。除非这个字符串只包含 ASCII,因为所有 ANSI 都兼容 ASCII,才恰好避免了乱码。
944
+
945
## 选择你的阵营!
946
947

0 commit comments