编码c语言CMD窗口 [英] encoding c-language CMD windows

查看:335
本文介绍了编码c语言CMD窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的c程序中有一个编码的问题。它似乎在Eclipse中工作得很好,但是在CMD在Windows中执行程序时,它不能显示瑞典语ÅÄÖ。

I have a problem with encoding in my c-programs. It seems to work fine in Eclipse but when executing the program in CMD in windows its not able to show the swedish "Å" "Ä" "Ö".

因为Windows XP的编码不同于我的c程序中的编码。

Is this because the encoding for the windows-XP is different from the encoding in my c-program.

我通过setlocale()查询本地设置,我得到以下:

I did query the local settings through setlocale() and I got the following:

Swedish_Sweden.1252

Swedish_Sweden.1252

有什么快速解决方案吗?

is there any quick solution to this?

推荐答案

使用命令 change codepage

chcp 850

这会将代码页更改为多语言确保您的字体可以显示您需要的字符。

which will change the code page to Multilingual (Latin I). Make sure your font can display the characters you need.

这篇关于编码c语言CMD窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆