使用cmd.exe以UTF-8编码保存文本文件 [英] Save text file in UTF-8 encoding using cmd.exe

查看:788
本文介绍了使用cmd.exe以UTF-8编码保存文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Windows的命令行cmd.exe以UTF-8编码保存文本文件?

Is it possible to save a text file in UTF-8 encoding using Windows' command line cmd.exe?

推荐答案

命令提示符的默认编码为Windows-1252。首先将代码页(chcp命令)更改为65001(UTF-8),然后运行您的命令。

The default encoding for command prompt is Windows-1252. Change the code page (chcp command) to 65001 (UTF-8) first and then run your command.

chcp 65001
C:\Windows\system32\ipconfig /all >> output.log

完成后将其恢复为默认值。

Change it back to default when done.

chcp 1252

这篇关于使用cmd.exe以UTF-8编码保存文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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