回显unicode字符 [英] Echo-ing unicode character
本文介绍了回显unicode字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想通过运行bat文件在cmd中回显Unicode字符é".我准备了一个简短的脚本:
I would like to echo the unicode character "é" in cmd via running bat file. I prepared a short script:
@echo off
SET message=Gép3
echo %message%
pause
我该怎么做?是否可以将这封信直接放入代码中?
how can I do that? Is there a possibility to put directly this letter into the code?
推荐答案
执行此操作(两者都很重要):
Do this (both are important):
- 使用代码页65001(UTF-8)
chcp 65001
- 保存.bat文件时,请使用UTF-8
i. e.以这种方式编辑示例代码:
i. e. edit your example code in this way:
@echo off
chcp 65001
SET message=Gép3
echo %message%
pause
同样,重要的是,您保存编码为UTF-8的.bat文件
这篇关于回显unicode字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文