c++ - std::wcout,为什么打印的字符和输入的不一样?
问题描述
尝试使用 std::wcout 打印“é”时,输出控制台改为打印“Ú”
https://www.utf8-chartable.de/unicode-utf8-table.pl使用这个网站我尝试使用 L"é" 或它的字符代码 0x00E9 打印 "é" 但我总是以 "Ú" 字符结束相反, std::cout << "é" 也产生相同的输出
#include <iostream>
#include <string>
int main()
{
// Prints the weird U
std::wcout << static_cast<wchar_t>(0x00E9);
// Also prints the weird U
std::wcout << L"é";
// Also prints the weird U
std::cout << "é";
return 0;
}
`
那么,谁能指出我做错了什么?
解决方案
推荐阅读
- amazon-web-services - AWS CLI 不接受访问密钥
- python - 如何将 selenium 编码更改为 utf-8
- php - Laravel SoftDeletes conflicts with Eloquent ORM
- python - CSV 文件循环仅循环一次
- javascript - 将 d3-cloud 与 rollup 集成(实际上是 Svelte)
- apache-spark - Spark 读取路径/文件名中带有空格的 csv 文件时出错
- php - 如何在php中绑定oracle关联数组?
- python - 从数据框中剥离字符并将剩余字符转换为浮点数
- android - 如何在android中单行处理多个网络调用的响应代码
- laravel - 计划使用 Laravel?