在批处理文件中使用箱形绘图Unicode字符 [英] Using box-drawing Unicode characters in batch files

查看:78
本文介绍了在批处理文件中使用箱形绘图Unicode字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作使用以下字符的批处理文件:

I am making a batch file that uses these characters:

˧ ˥ ˪ ˫

它不起作用,它只是自身终止。
我见过人们使用这样的字符:

It is not working, it just terminates itself. I have seen people use characters like this:

Å

它不是字符,但变成了字符,有人可以给我列出这些字符,显示上面字母的类型以及它变成什么吗? / p>

It isnt the character but it turns into a character, can someone give me a list of these, shows the type of letter above and what it turns into?

推荐答案

如果要编写使用这些字符的控制台批处理文件,则需要一个编辑器,该编辑器将使用控制台的命令保存批处理文件。代码页。要检查是什么,请输入:

If you want to write console batch files that use those characters, you need an editor that will save the batch file using the console's code page. To check what that is, type:

C:\>chcp
Active code page: 437

这是我的美国Windows系统的结果。西欧Windows版本通常是代码页850。

This is the result for my US Windows system. Western European versions of Windows will often be code page 850.

好的编辑器是记事本++ 。在编辑器中设置该编码(编码,字符集,西欧,OEM-US),并将以下字符复制到其中:

A good editor is Notepad++. Set that encoding in the editor (Encoding, Character sets, Western European, OEM-US) and copy the following characters into it:

@echo off
echo ╔═╦═╗ ┌─┬─┐ ╓─╥─╖ ╒═╤═╕
echo ║ ║ ║ │ │ │ ║ ║ ║ │ │ │
echo ╠═╬═╣ ├─┼─┤ ╟─╫─╢ ╞═╪═╡
echo ║ ║ ║ │ │ │ ║ ║ ║ │ │ │
echo ╚═╩═╝ └─┴─┘ ╙─╨─╜ ╘═╧═╛

将文件另存为 test.bat 并从控制台运行它:

Save the file as test.bat and run it from the console:

C:\>test
╔═╦═╗ ┌─┬─┐ ╓─╥─╖ ╒═╤═╕
║ ║ ║ │ │ │ ║ ║ ║ │ │ │
╠═╬═╣ ├─┼─┤ ╟─╫─╢ ╞═╪═╡
║ ║ ║ │ │ │ ║ ║ ║ │ │ │
╚═╩═╝ └─┴─┘ ╙─╨─╜ ╘═╧═╛

在Notepad ++中再次打开文件时,可能会看到以下内容:

When you open the file again in Notepad++, it is possible that you will see something like:

@echo off
echo ÉÍËÍ» ÚÄÂÄ¿ ÖÄÒÄ· ÕÍÑ͸
echo º º º ³ ³ ³ º º º ³ ³ ³
echo ÌÍÎ͹ ÃÄÅÄ´ ÇÄ×Ķ ÆÍØ͵
echo º º º ³ ³ ³ º º º ³ ³ ³
echo ÈÍÊͼ ÀÄÁÄÙ ÓÄÐĽ ÔÍÏ;

由于文件中没有指示什么c od页面中的字符代表,Notepad ++可以选择所谓的 ANSI 代码页。在美国Windows上是 Windows-1252 。只需再次选择 OEM-US 编码即可正确显示。

Since there is no indication in the file what code page the characters in it represent, Notepad++ may choose the so-called ANSI code page. On US Windows that is Windows-1252. Just select the OEM-US encoding again to display it properly.

这篇关于在批处理文件中使用箱形绘图Unicode字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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