在cmd中批处理文件中使用非ASCII字符 [英] Using non-ASCII characters in cmd batch file
问题描述
我工作的一个.BAT程序,程序是写在芬兰。问题是,CMD不知道这些特殊的字母,如: A,O,A
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 : Ä, Ö, Å.
有没有一种方法,使这些工作?我也想,如果用户可以使用这些信了。
Is there a way to make those work? I'd also like it if the user could use those letters too.
我的code的部分:
@echo off
/u
title JustATestProgram
goto test123
:test123
echo Letters : Ää Öö Åå
pause
exit
当我打开这个文件,信件是这样的:
When I open this file, the letters look like this:
推荐答案
如果您使用记事本+ +,你可以简单地改变字符集。这样做将允许你写从所需的字符集字母。西部地区-US。应该支持。您可以通过编写CHCP 437.但我建议在记事本中这样做++作为它将显示输出,因为它会在批量做,在下拉菜单中的记事本++或手工菜单。所以youbwill然后很容易地看到,如果ü使用权code页面。而在同一时间,它很容易切换如果u想要更多的特殊符号。您还可以在previous职位说明。尝试UTF-8,你可以阅读更多有关在这里这样: http://ss64.com/nt/chcp.html 这里是在不同的code页面的列表。退房的OEM页。的https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).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屋!