在cmd批处理文件中使用非ASCII字符 [英] Using non-ASCII characters in cmd batch file
问题描述
我正在开发一个.bat程序,程序是用芬兰语写的。问题是CMD不知道这些特殊字母,例如:Ä,Ö,Å。
I'm working on a .bat program and the program is written in Finnish. The problem is that CMD doesn't know these "special" letters such as : Ä, Ö, Å.
使这些工作?
我的代码的一部分:
@echo off
/u
title JustATestProgram
goto test123
:test123
echo Letters : Ää Öö Åå
pause
exit
当我打开这个文件时,字母看起来像这样:
When I open this file, the letters look like this:
>
推荐答案
如果你使用notepad ++,你可以简单的改变字符集。这样做将允许你从所需的字符集写信。西部地区-US。应该支持它。你可以在记事本++的下拉菜单中或通过写chcp 437手动执行它。但我建议在notepad ++中这样做,因为它会显示输出,因为它将在批处理。所以youbwill然后很容易看到如果你使用正确的代码页。同时,如果你想要更多的特殊符号,它很容易切换。你也可以在前面的帖子中说。尝试utf- 8,您可以在这里阅读更多内容: http://ss64.com/nt/chcp.html ,这里是不同代码页的列表。查看OEM页。 https://msdn.microsoft。 com / en-us / library / windows / desktop / dd317756(v = vs85).aspx
If you use notepad++ you can simply change the charset. Doing this will allow you to write letters from desired charset. The western region -US. should support it. You can do it in drop down menu in notepad++ or by hand by writing chcp 437. But I recommend doing this in notepad++ as it will show you the output as it will be in the batch. So youbwill then easily see if u use right code page. And at same time it's easy to switch if u want more special symbols. You can also as stated in previous posts. Try utf- 8 you can read more about thus here: http://ss64.com/nt/chcp.html and here's an list over different code pages. Check out the OEM pages. https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx
这篇关于在cmd批处理文件中使用非ASCII字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!