【问题标题】:How to really print EURO sign in c++ application console in Windows如何在 Windows 中的 c++ 应用程序控制台中真正打印欧元符号
【发布时间】:2017-01-11 19:19:10
【问题描述】:

我的目标是在 Windows 的 c++ 应用程序中打印欧元符号 - €。已经尝试但无效的方法是:

#include <windows.h>
SetConsoleOutputCP(1252);
cout << "\u20a0";

"\u20a0" 也没有工作并且没有SetConsoleOutputCP()。到目前为止还没有可行的解决方案。这么多论坛和问题,没有直接答案....

【问题讨论】:

标签: c++ console output cout


【解决方案1】:

这对我有用

SetConsoleOutputCP(1252);
cout << (char)(128);

【讨论】:

  • 或者:cout &lt;&lt; "\x80"; 或者,查看WideCharToMultiByte()
猜你喜欢
  • 2010-12-30
  • 2023-03-19
  • 1970-01-01
  • 2023-01-03
  • 2023-03-21
  • 2010-11-25
  • 2015-05-28
  • 1970-01-01
相关资源
最近更新 更多