如何输出法语字母

chenyunkai 2012-08-21 12:12:26
在下是个新手,输出法语字母遇到了问题
毕竟也是在dos下输出的,
我用了宽字符 wstring
我试过,用它储存日文啊,俄文,然后wcout都是可以显示的,
但是用它储存法语的特殊字母,é è à â ê û î ô ù ë的话
大部分是显示不出来的,请问 我如果想在dos下输出法语这些特殊字符,该怎么办好。
我已经setlocale(LC_ALL,"fra");
但还是不行啊
...全文
248 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2012-08-21
  • 打赏
  • 举报
回复
另外请参考下图:
赵4老师 2012-08-21
  • 打赏
  • 举报
回复
French French (Belgian) "frb" or "french-belgian"
French French (Canadian) "frc" or "french-canadian"
French French (default) "fra"or "french"
French French (Swiss) "french-swiss" or "frs"
仅供参考
chenyunkai 2012-08-21
  • 打赏
  • 举报
回复
非常感谢!!
赵4老师 2012-08-21
  • 打赏
  • 举报
回复
Unicode 0x00E0~0x00FF
赵4老师 2012-08-21
  • 打赏
  • 举报
回复
system("chcp 437");//或者SetConsoleCP(437);
cprintf("\x81\x82\x83\x84\x85\x86\n");
参考:
SetConsoleCP
The SetConsoleCP function sets the input code page used by the console associated with the calling process. A console uses its input code page to translate keyboard input into the corresponding character value.

BOOL SetConsoleCP(
UINT wCodePageID // code page to set
);

Parameters
wCodePageID
Specifies the identifier of the code page to set. The identifiers of the code pages available on the local computer are stored in the registry under the following key.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage

Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
A code page maps 256 character codes to individual characters. Different code pages include different special characters, typically customized for a language or a group of languages.

To determine a console's current input code page, use the GetConsoleCP function. To set and retrieve a console's output code page, use the SetConsoleOutputCP and GetConsoleOutputCP functions.

chenyunkai 2012-08-21
  • 打赏
  • 举报
回复
但是如何能正确输出这些字符,而不是各种??呢

64,683

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧