相关疑难解决方法(0)

Visual Studio 2019 C++ 项目中的特殊字符并用它们执行 CMD 命令

首先,我只想在控制台中使用波罗的海字符并用它们执行 CMD 命令,但问题是从默认/标准控制台 C++ 应用程序开始的。

\n
#include <iostream>\nint main() {\n    string output = "\xc4\x81\xc4\x81\xc4\x81\xc4\x8d\xc4\x8d\xc4\x8d\xc4\x93\xc4\x93\xc4\x93\xc4\x93";\n\n    cout << output << endl;\n}\n
Run Code Online (Sandbox Code Playgroud)\n

早些时候,我在堆栈上提出了这个问题 - How to use UTF8characters in DEFAULT C++ Project OR when using mysql Connector for C++ in Visual Studio 2019 (Latin7_general_ci to UTF-8)?

\n

我在测试中发现:如果我将 UTF8 字符串转换为 Latin1 字符串,然后 cout 或打印十六进制值,我会在控制台中输出一些特殊字符。例如 -

\n
**char s2[256] = "\\xc3\\xa9";**  printed is outputted as "\xc4\xb7" THAT MEANS I need to convert strings into correct HEX values when it is needed, and some …
Run Code Online (Sandbox Code Playgroud)

c++ utf-8 iso-8859-1 visual-studio

0
推荐指数
1
解决办法
1567
查看次数

标签 统计

c++ ×1

iso-8859-1 ×1

utf-8 ×1

visual-studio ×1